疯狂的狮子li
2022-03-09 8a89054c2f1dfa06c6dfc744217b35e66b8a3661
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
@@ -80,7 +80,7 @@
            .and(ObjectUtil.isNotNull(user.getDeptId()), w -> {
                List<SysDept> deptList = deptMapper.selectList(new LambdaQueryWrapper<SysDept>()
                    .select(SysDept::getDeptId)
                    .apply("find_in_set({0},ancestors)", user.getDeptId()));
                    .apply("find_in_set({0},ancestors) <> 0", user.getDeptId()));
                w.eq("u.dept_id", user.getDeptId())
                    .or()
                    .in("u.dept_id", deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList()));