update 优化 数据权限 减少二次校验查询

This commit is contained in:
疯狂的狮子Li 2023-10-13 11:25:46 +08:00
parent 7544ae318c
commit 2affe91837
1 changed files with 2 additions and 5 deletions

View File

@ -49,11 +49,8 @@ public class SysDataScopeServiceImpl implements ISysDataScopeService {
.apply(DataBaseHelper.findInSet(deptId, "ancestors")));
List<Long> ids = StreamUtils.toList(deptList, SysDept::getDeptId);
ids.add(deptId);
List<SysDept> list = deptMapper.selectList(new LambdaQueryWrapper<SysDept>()
.select(SysDept::getDeptId)
.in(SysDept::getDeptId, ids));
if (CollUtil.isNotEmpty(list)) {
return StreamUtils.join(list, d -> Convert.toStr(d.getDeptId()));
if (CollUtil.isNotEmpty(ids)) {
return StreamUtils.join(ids, Convert::toStr);
}
return null;
}