diff --git a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/mapper/DeptMapper.java b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/mapper/DeptMapper.java index 68c22ba9..2b7c4785 100644 --- a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/mapper/DeptMapper.java +++ b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/mapper/DeptMapper.java @@ -10,15 +10,15 @@ import java.util.Set; @Mapper public interface DeptMapper extends BaseMapper { - List selectDeptByCriteria(@Param("criteria") QueryDeptRequest criteria); + List queryDeptListByArgs(@Param("criteria") QueryDeptRequest criteria); - List selectDeptByPid(@Param("pid") Long pid); + List queryDeptListByPid(@Param("pid") Long pid); int getDeptCountByPid(@Param("pid") Long pid); - List selectDeptByPidIsNull(); + List queryDeptListByPidIsNull(); - Set selectDeptByRoleId(@Param("roleId") Long roleId); + Set queryDeptSetByRoleId(@Param("roleId") Long roleId); void updateSubCountById(@Param("count") Integer count, @Param("id") Long id); } \ No newline at end of file diff --git a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/DeptServiceImpl.java b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/DeptServiceImpl.java index 36e34268..537a14c8 100644 --- a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/DeptServiceImpl.java +++ b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/DeptServiceImpl.java @@ -72,7 +72,7 @@ public class DeptServiceImpl extends ServiceImpl implements De } // 数据权限 criteria.setIds(SecurityHelper.getCurrentUserDataScope()); - List list = deptMapper.selectDeptByCriteria(criteria); + List list = deptMapper.queryDeptListByArgs(criteria); // 如果为空,就代表为自定义权限或者本级权限,就需要去重,不理解可以注释掉,看查询结果 if (StringUtil.isBlank(dataScopeType)) { return deduplication(list); @@ -93,12 +93,12 @@ public class DeptServiceImpl extends ServiceImpl implements De @Override public List selectDeptByPid(long pid) { - return deptMapper.selectDeptByPid(pid); + return deptMapper.queryDeptListByPid(pid); } @Override public Set selectDeptByRoleId(Long id) { - return deptMapper.selectDeptByRoleId(id); + return deptMapper.queryDeptSetByRoleId(id); } @Override @@ -158,7 +158,7 @@ public class DeptServiceImpl extends ServiceImpl implements De public Set selectRelationDept(List menuList, Set deptSet) { for (Dept dept : menuList) { deptSet.add(dept); - List deptList = deptMapper.selectDeptByPid(dept.getId()); + List deptList = deptMapper.queryDeptListByPid(dept.getId()); if (CollUtil.isNotEmpty(deptList)) { selectRelationDept(deptList, deptSet); } @@ -171,7 +171,7 @@ public class DeptServiceImpl extends ServiceImpl implements De List list = new ArrayList<>(); deptList.forEach(dept -> { if (dept != null && dept.getEnabled()) { - List deptList1 = deptMapper.selectDeptByPid(dept.getId()); + List deptList1 = deptMapper.queryDeptListByPid(dept.getId()); if (CollUtil.isNotEmpty(deptList1)) { list.addAll(selectChildDeptIdByDeptIds(deptList1)); } @@ -185,10 +185,10 @@ public class DeptServiceImpl extends ServiceImpl implements De @Override public List selectSuperiorDeptByPid(Dept dept, List deptList) { if (dept.getPid() == null) { - deptList.addAll(deptMapper.selectDeptByPidIsNull()); + deptList.addAll(deptMapper.queryDeptListByPidIsNull()); return deptList; } - deptList.addAll(deptMapper.selectDeptByPid(dept.getPid())); + deptList.addAll(deptMapper.queryDeptListByPid(dept.getPid())); return selectSuperiorDeptByPid(getDeptById(dept.getPid()), deptList); } diff --git a/cutejava/cutejava-system/src/main/resources/mapper/DeptMapper.xml b/cutejava/cutejava-system/src/main/resources/mapper/DeptMapper.xml index 0d88c88f..34127b51 100644 --- a/cutejava/cutejava-system/src/main/resources/mapper/DeptMapper.xml +++ b/cutejava/cutejava-system/src/main/resources/mapper/DeptMapper.xml @@ -13,7 +13,7 @@ - SELECT dept_id, `name`, @@ -52,7 +52,7 @@ ORDER BY dept_sort - select dept_id, name, pid, @@ -71,7 +71,7 @@ from sys_dept where pid = #{pid} - select dept_id, name, pid, @@ -85,7 +85,7 @@ from sys_dept where pid is null - SELECT d.dept_id AS id, d.NAME, d.pid,