package com.chushang.system.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chushang.common.mybatis.page.CommonParam;
import com.chushang.common.mybatis.utils.PageResult;
import com.chushang.system.entity.po.SysDictType;

import java.util.List;

/**
 * @auther: zhao
 * @date: 2024/5/9 15:53
 */
public interface ISysDictTypeService extends IService<SysDictType> {
    PageResult pageDictTypeList(SysDictType dictType, CommonParam commonParam);
    default List<SysDictType> allDictTypeList(SysDictType dictType, CommonParam commonParam){
        return this.list(buildWrapper(dictType, commonParam));
    }

    LambdaQueryWrapper<SysDictType> buildWrapper(SysDictType dictType, CommonParam commonParam);

    default boolean checkDictTypeUnique(SysDictType dictType, CommonParam commonParam){
        return this.count(buildWrapper(dictType, commonParam)) > 0;
    }
    // todo
    default void resetDictCache(){}

}
