| | |
| | | |
| | | public LambdaQueryWrapper<IpVolumeFile> listFile(BaseConditionVO baseConditionVO, String keyword) { |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | LambdaQueryWrapper<IpVolumeFile> wrapper; |
| | | LambdaQueryWrapper<IpVolumeFile> wrapper = Wrappers.lambdaQuery(IpVolumeFile.class); |
| | | |
| | | if (SecurityUtils.getClientId() == null) { |
| | | wrapper = Wrappers.lambdaQuery(IpVolumeFile.class); |
| | | } else { |
| | | if (clientService.findClientId()) { |
| | | wrapper = Wrappers.lambdaQuery(IpVolumeFile.class).eq(IpVolumeFile::getUserId, SecurityUtils.getUserId()); |
| | | } else { |
| | | wrapper = Wrappers.lambdaQuery(IpVolumeFile.class).eq(IpVolumeFile::getClientId, clientService.getClientId()) |
| | | .or(file -> { |
| | | file.eq(IpVolumeFile::getClientId, SecurityUtils.getUserId()); |
| | | }); |
| | | } |
| | | //不是超管 |
| | | if (SecurityUtils.getClientId() != null) { |
| | | wrapper = wrapper.eq(IpVolumeFile::getClientId, SecurityUtils.getUserId()) |
| | | .or(file -> { |
| | | file.eq(IpVolumeFile::getUserId, SecurityUtils.getUserId()); |
| | | }); |
| | | } |
| | | |
| | | |
| | | if (keyword.isEmpty()) { |
| | | return wrapper; |
| | | } else { |
| | | return wrapper.like(IpVolumeFile::getFileName, keyword); |
| | | if (keyword != null && !keyword.isEmpty()) { |
| | | wrapper.like(IpVolumeFile::getFileName, keyword); |
| | | } |
| | | return wrapper; |
| | | } |
| | | |
| | | |