package com.jsh.erp.datasource.mappers; import com.jsh.erp.datasource.entities.SysDictItem; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.util.List; @Mapper public interface SysDictItemMapper { List selectByDictId(Long dictId); SysDictItem selectById(Long id); int insert(SysDictItem sysDictItem); int update(SysDictItem sysDictItem); int deleteById(Long id); int deleteByDictId(Long dictId); //通过字典类型和字典code查询具体一条 @Select("SELECT * FROM sys_dict_item di LEFT JOIN sys_dict d ON di.dict_id = d.id WHERE d.dict_code = #{dictCode} AND di.item_text = #{itemText}") SysDictItem getByDictCodeAndItemText(String dictCode, String itemText); List getItemsByDictCode(@Param("dictCode") String dictCode); }