DictMapper.java 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. package com.huaxu.dao;
  2. import com.baomidou.mybatisplus.core.metadata.IPage;
  3. import com.huaxu.dto.DictDto;
  4. import com.huaxu.entity.Dict;
  5. import org.apache.ibatis.annotations.Mapper;
  6. import org.apache.ibatis.annotations.Param;
  7. import java.util.List;
  8. /**
  9. * 数据字典(Dict)表数据库访问层
  10. *
  11. * @author yjy
  12. * @since 2020-10-26
  13. */
  14. @Mapper
  15. public interface DictMapper {
  16. /**
  17. * 通过ID查询单条数据
  18. *
  19. * @param id 主键
  20. * @return 实例对象
  21. */
  22. Dict selectById(Integer id);
  23. /**
  24. * 查询全部
  25. *
  26. * @return 对象列表
  27. */
  28. List<Dict> selectAll();
  29. /**
  30. * 通过实体作为筛选条件查询
  31. *
  32. * @param dict 实例对象
  33. * @return 对象列表
  34. */
  35. List<Dict> selectList(Dict dict);
  36. /**
  37. * 新增数据
  38. *
  39. * @param dict 实例对象
  40. * @return 影响行数
  41. */
  42. int insert(Dict dict);
  43. /**
  44. * 批量新增
  45. *
  46. * @param dicts 实例对象的集合
  47. * @return 影响行数
  48. */
  49. int batchInsert(List<Dict> dicts);
  50. /**
  51. * 修改数据
  52. *
  53. * @param dict 实例对象
  54. * @return 影响行数
  55. */
  56. int update(Dict dict);
  57. /**
  58. * 通过主键删除数据
  59. *
  60. * @param ids 主键
  61. * @return 影响行数
  62. */
  63. int deleteById(@Param("ids") Long[] ids);
  64. /**
  65. * 查询总数据数
  66. *
  67. * @return 数据总数
  68. */
  69. int count();
  70. IPage<Dict> selectPage(IPage<Dict> page, Dict dict);
  71. /**
  72. * 字典编码和父配置ID数量
  73. *
  74. * @return 数据总数
  75. */
  76. int countByCodePid(Dict dict);
  77. /**
  78. * 查询父列表
  79. *
  80. * @param dict 实例对象
  81. * @return 对象列表
  82. */
  83. List<DictDto> selectParentList(Dict dict);
  84. }