ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
@@ -82,9 +82,9 @@ List<SysDept> deptList = deptMapper.selectList(new LambdaQueryWrapper<SysDept>() .select(SysDept::getDeptId) .apply(DataBaseHelper.findInSet(user.getDeptId(), "ancestors"))); w.eq("u.dept_id", user.getDeptId()) .or() .in("u.dept_id", deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList())); List<Long> ids = deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList()); ids.add(user.getDeptId()); w.in("u.dept_id", ids); }); return wrapper; }