upd: 编码规范

This commit is contained in:
2025-04-09 19:10:38 +08:00
parent 285df6bb4d
commit 4127365d42
3 changed files with 15 additions and 15 deletions
@@ -10,15 +10,15 @@ import java.util.Set;
@Mapper
public interface DeptMapper extends BaseMapper<Dept> {
List<Dept> selectDeptByCriteria(@Param("criteria") QueryDeptRequest criteria);
List<Dept> queryDeptListByArgs(@Param("criteria") QueryDeptRequest criteria);
List<Dept> selectDeptByPid(@Param("pid") Long pid);
List<Dept> queryDeptListByPid(@Param("pid") Long pid);
int getDeptCountByPid(@Param("pid") Long pid);
List<Dept> selectDeptByPidIsNull();
List<Dept> queryDeptListByPidIsNull();
Set<Dept> selectDeptByRoleId(@Param("roleId") Long roleId);
Set<Dept> queryDeptSetByRoleId(@Param("roleId") Long roleId);
void updateSubCountById(@Param("count") Integer count, @Param("id") Long id);
}
@@ -72,7 +72,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements De
}
// 数据权限
criteria.setIds(SecurityHelper.getCurrentUserDataScope());
List<Dept> list = deptMapper.selectDeptByCriteria(criteria);
List<Dept> list = deptMapper.queryDeptListByArgs(criteria);
// 如果为空,就代表为自定义权限或者本级权限,就需要去重,不理解可以注释掉,看查询结果
if (StringUtil.isBlank(dataScopeType)) {
return deduplication(list);
@@ -93,12 +93,12 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements De
@Override
public List<Dept> selectDeptByPid(long pid) {
return deptMapper.selectDeptByPid(pid);
return deptMapper.queryDeptListByPid(pid);
}
@Override
public Set<Dept> selectDeptByRoleId(Long id) {
return deptMapper.selectDeptByRoleId(id);
return deptMapper.queryDeptSetByRoleId(id);
}
@Override
@@ -158,7 +158,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements De
public Set<Dept> selectRelationDept(List<Dept> menuList, Set<Dept> deptSet) {
for (Dept dept : menuList) {
deptSet.add(dept);
List<Dept> deptList = deptMapper.selectDeptByPid(dept.getId());
List<Dept> deptList = deptMapper.queryDeptListByPid(dept.getId());
if (CollUtil.isNotEmpty(deptList)) {
selectRelationDept(deptList, deptSet);
}
@@ -171,7 +171,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements De
List<Long> list = new ArrayList<>();
deptList.forEach(dept -> {
if (dept != null && dept.getEnabled()) {
List<Dept> deptList1 = deptMapper.selectDeptByPid(dept.getId());
List<Dept> deptList1 = deptMapper.queryDeptListByPid(dept.getId());
if (CollUtil.isNotEmpty(deptList1)) {
list.addAll(selectChildDeptIdByDeptIds(deptList1));
}
@@ -185,10 +185,10 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements De
@Override
public List<Dept> selectSuperiorDeptByPid(Dept dept, List<Dept> 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);
}
@@ -13,7 +13,7 @@
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<select id="selectDeptByCriteria" resultMap="BaseResultMap">
<select id="queryDeptListByArgs" resultMap="BaseResultMap">
SELECT
dept_id,
`name`,
@@ -52,7 +52,7 @@
</where>
ORDER BY dept_sort
</select>
<select id="selectDeptByPid" resultMap="BaseResultMap">
<select id="queryDeptListByPid" resultMap="BaseResultMap">
select dept_id,
name,
pid,
@@ -71,7 +71,7 @@
from sys_dept
where pid = #{pid}
</select>
<select id="selectDeptByPidIsNull" resultMap="BaseResultMap">
<select id="queryDeptListByPidIsNull" resultMap="BaseResultMap">
select dept_id,
name,
pid,
@@ -85,7 +85,7 @@
from sys_dept
where pid is null
</select>
<select id="selectDeptByRoleId" resultType="cn.odboy.model.system.domain.Dept">
<select id="queryDeptSetByRoleId" resultType="cn.odboy.model.system.domain.Dept">
SELECT d.dept_id AS id,
d.NAME,
d.pid,