SysDeptMapper.java 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. package com.ruoyi.system.mapper;
  2. import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  3. import com.ruoyi.common.core.domain.entity.SysDept;
  4. import org.apache.ibatis.annotations.Param;
  5. import org.apache.ibatis.annotations.Select;
  6. import java.util.List;
  7. import java.util.Map;
  8. /**
  9. * 部门管理 数据层
  10. *
  11. * @author ruoyi
  12. */
  13. public interface SysDeptMapper extends BaseMapper<SysDept> {
  14. /**
  15. * 查询部门管理数据
  16. *
  17. * @param dept 部门信息
  18. * @return 部门信息集合
  19. */
  20. public List<SysDept> selectDeptList(SysDept dept);
  21. /**
  22. * 根据角色ID查询部门树信息
  23. *
  24. * @param roleId 角色ID
  25. * @param deptCheckStrictly 部门树选择项是否关联显示
  26. * @return 选中部门列表
  27. */
  28. public List<Long> selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly);
  29. /**
  30. * 根据部门ID查询信息
  31. *
  32. * @param deptId 部门ID
  33. * @return 部门信息
  34. */
  35. public SysDept selectDeptById(Long deptId);
  36. /**
  37. * 根据ID查询所有子部门
  38. *
  39. * @param deptId 部门ID
  40. * @return 部门列表
  41. */
  42. public List<SysDept> selectChildrenDeptById(Long deptId);
  43. /**
  44. * 根据ID查询所有子部门(正常状态)
  45. *
  46. * @param deptId 部门ID
  47. * @return 子部门数
  48. */
  49. public int selectNormalChildrenDeptById(Long deptId);
  50. /**
  51. * 是否存在子节点
  52. *
  53. * @param deptId 部门ID
  54. * @return 结果
  55. */
  56. public int hasChildByDeptId(Long deptId);
  57. /**
  58. * 查询部门是否存在用户
  59. *
  60. * @param deptId 部门ID
  61. * @return 结果
  62. */
  63. public int checkDeptExistUser(Long deptId);
  64. /**
  65. * 校验部门名称是否唯一
  66. *
  67. * @param deptName 部门名称
  68. * @param parentId 父部门ID
  69. * @return 结果
  70. */
  71. public SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId);
  72. /**
  73. * 新增部门信息
  74. *
  75. * @param dept 部门信息
  76. * @return 结果
  77. */
  78. public int insertDept(SysDept dept);
  79. /**
  80. * 修改部门信息
  81. *
  82. * @param dept 部门信息
  83. * @return 结果
  84. */
  85. public int updateDept(SysDept dept);
  86. /**
  87. * 修改所在部门正常状态
  88. *
  89. * @param deptIds 部门ID组
  90. */
  91. public void updateDeptStatusNormal(Long[] deptIds);
  92. /**
  93. * 修改子元素关系
  94. *
  95. * @param depts 子元素
  96. * @return 结果
  97. */
  98. public int updateDeptChildren(@Param("depts") List<SysDept> depts);
  99. /**
  100. * 删除部门管理信息
  101. *
  102. * @param deptId 部门ID
  103. * @return 结果
  104. */
  105. public int deleteDeptById(Long deptId);
  106. @Select("SELECT dept_id AS deptId, dept_name AS deptName, parent_id AS parentId FROM sys_dept WHERE status ='0' ORDER BY order_num ASC")
  107. List<Map<String, Object>> treeList();
  108. }