SysDeptMapper.java 2.9 KB

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