
package com.pavis.admin.system.mapper;

import com.alicp.jetcache.anno.Cached;
import org.apache.ibatis.annotations.Param;
import com.pavis.admin.common.constant.CacheConstants;
import com.pavis.admin.system.model.entity.DictItemDO;
import top.continew.starter.data.mp.base.BaseMapper;
import top.continew.starter.extension.crud.model.resp.LabelValueResp;

import java.util.List;

/**
 * 字典项 Mapper
 *
 *
 * @since 2023/9/11 21:29
 */
public interface DictItemMapper extends BaseMapper<DictItemDO> {

    /**
     * 根据字典编码查询
     *
     * @param dictCode 字典编码
     * @return 字典项列表
     */
    @Cached(key = "#dictCode", name = CacheConstants.DICT_KEY_PREFIX)
    List<LabelValueResp> listByDictCode(@Param("dictCode") String dictCode);
}