8e3b9ce62c387801914675b3708a4cf6f4e83680.svn-base 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. package org.jeecg.modules.system.mapper;
  2. import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  3. import com.baomidou.mybatisplus.core.metadata.IPage;
  4. import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  5. import org.apache.ibatis.annotations.Param;
  6. import org.apache.ibatis.annotations.Select;
  7. import org.apache.ibatis.annotations.Update;
  8. import org.jeecg.common.system.vo.DictModel;
  9. import org.jeecg.common.system.vo.DictModelMany;
  10. import org.jeecg.common.system.vo.DictQuery;
  11. import org.jeecg.modules.system.entity.SysDict;
  12. import org.jeecg.modules.system.model.DuplicateCheckVo;
  13. import org.jeecg.modules.system.model.TreeSelectModel;
  14. import java.util.List;
  15. import java.util.Map;
  16. /**
  17. * <p>
  18. * 字典表 Mapper 接口
  19. * </p>
  20. *
  21. * @Author zhangweijian
  22. * @since 2018-12-28
  23. */
  24. public interface SysDictMapper extends BaseMapper<SysDict> {
  25. /**
  26. * 重复检查SQL
  27. * @return
  28. */
  29. @Deprecated
  30. public Long duplicateCheckCountSql(DuplicateCheckVo duplicateCheckVo);
  31. @Deprecated
  32. public Long duplicateCheckCountSqlNoDataId(DuplicateCheckVo duplicateCheckVo);
  33. public List<DictModel> queryDictItemsByCode(@Param("code") String code);
  34. /**
  35. * 查询有效的数据字典项
  36. * @param code
  37. * @return
  38. */
  39. List<DictModel> queryEnableDictItemsByCode(@Param("code") String code);
  40. /**
  41. * 通过多个字典code获取字典数据
  42. *
  43. * @param dictCodeList
  44. * @return
  45. */
  46. public List<DictModelMany> queryDictItemsByCodeList(@Param("dictCodeList") List<String> dictCodeList);
  47. @Deprecated
  48. public List<DictModel> queryTableDictItemsByCode(@Param("table") String table,@Param("text") String text,@Param("code") String code);
  49. @Deprecated
  50. public List<DictModel> queryTableDictItemsByCodeAndFilter(@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("filterSql") String filterSql);
  51. @Deprecated
  52. @Select("select ${key} as \"label\",${value} as \"value\" from ${table}")
  53. public List<Map<String,String>> getDictByTableNgAlain(@Param("table") String table, @Param("key") String key, @Param("value") String value);
  54. public String queryDictTextByKey(@Param("code") String code,@Param("key") String key);
  55. /**
  56. * 可通过多个字典code查询翻译文本
  57. * @param dictCodeList 多个字典code
  58. * @param keys 数据列表
  59. * @return
  60. */
  61. List<DictModelMany> queryManyDictByKeys(@Param("dictCodeList") List<String> dictCodeList, @Param("keys") List<String> keys);
  62. @Deprecated
  63. public String queryTableDictTextByKey(@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("key") String key);
  64. /**
  65. * 通过查询指定table的 text code key 获取字典值,可批量查询
  66. *
  67. * @param table
  68. * @param text
  69. * @param code
  70. * @param keys
  71. * @return
  72. */
  73. @Deprecated
  74. List<DictModel> queryTableDictTextByKeys(@Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("keys") List<String> keys);
  75. @Deprecated
  76. public List<DictModel> queryTableDictByKeys(@Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("keyArray") String[] keyArray);
  77. /**
  78. * 查询所有部门 作为字典信息 id -->value,departName -->text
  79. * @return
  80. */
  81. public List<DictModel> queryAllDepartBackDictModel();
  82. /**
  83. * 查询所有用户 作为字典信息 username -->value,realname -->text
  84. * @return
  85. */
  86. public List<DictModel> queryAllUserBackDictModel();
  87. /**
  88. * 通过关键字查询出字典表
  89. * @param table
  90. * @param text
  91. * @param code
  92. * @param keyword
  93. * @return
  94. */
  95. @Deprecated
  96. public List<DictModel> queryTableDictItems(@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("keyword") String keyword);
  97. /**
  98. * 通过关键字查询出字典表
  99. * @param page
  100. * @param table
  101. * @param text
  102. * @param code
  103. * @param keyword
  104. * @return
  105. */
  106. IPage<DictModel> queryTableDictItems(Page<DictModel> page, @Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("keyword") String keyword);
  107. /**
  108. * 根据表名、显示字段名、存储字段名 查询树
  109. * @param table
  110. * @param text
  111. * @param code
  112. * @param pid
  113. * @param hasChildField
  114. * @return
  115. */
  116. @Deprecated
  117. List<TreeSelectModel> queryTreeList(@Param("query") Map<String, String> query,@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("pidField") String pidField,@Param("pid") String pid,@Param("hasChildField") String hasChildField);
  118. /**
  119. * 删除
  120. * @param id
  121. */
  122. @Select("delete from sys_dict where id = #{id}")
  123. public void deleteOneById(@Param("id") String id);
  124. /**
  125. * 查询被逻辑删除的数据
  126. * @return
  127. */
  128. @Select("select * from sys_dict where del_flag = 1")
  129. public List<SysDict> queryDeleteList();
  130. /**
  131. * 修改状态值
  132. * @param delFlag
  133. * @param id
  134. */
  135. @Update("update sys_dict set del_flag = #{flag,jdbcType=INTEGER} where id = #{id,jdbcType=VARCHAR}")
  136. public void updateDictDelFlag(@Param("flag") int delFlag, @Param("id") String id);
  137. /**
  138. * 分页查询字典表数据
  139. * @param page
  140. * @param query
  141. * @return
  142. */
  143. @Deprecated
  144. public Page<DictModel> queryDictTablePageList(Page page, @Param("query") DictQuery query);
  145. /**
  146. * 查询 字典表数据 支持查询条件 分页
  147. * @param page
  148. * @param table
  149. * @param text
  150. * @param code
  151. * @param filterSql
  152. * @return
  153. */
  154. @Deprecated
  155. IPage<DictModel> queryTableDictWithFilter(Page<DictModel> page, @Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("filterSql") String filterSql);
  156. /**
  157. * 查询 字典表数据 支持查询条件 查询所有
  158. * @param table
  159. * @param text
  160. * @param code
  161. * @param filterSql
  162. * @return
  163. */
  164. @Deprecated
  165. List<DictModel> queryAllTableDictItems(@Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("filterSql") String filterSql);
  166. }