| | |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.helper.DataBaseHelper; |
| | | import com.ruoyi.common.helper.LoginHelper; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.domain.SysPost; |
| | |
| | | .and(ObjectUtil.isNotNull(user.getDeptId()), w -> { |
| | | List<SysDept> deptList = deptMapper.selectList(new LambdaQueryWrapper<SysDept>() |
| | | .select(SysDept::getDeptId) |
| | | .apply("find_in_set({0},ancestors) <> 0", user.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())); |