Merge remote-tracking branch 'origin/master'
# Conflicts:
# dao/src/main/resources/mapper/PlatformFileMapper.xml
| | |
| | | * |
| | | FROM |
| | | platform_file t1 |
| | | <where> |
| | | <if test="fileIdList!=null"> |
| | | t1.file_id IN |
| | | <foreach collection="fileIdList" open="(" close=")" item="fileId" separator=","> |
| | | #{fileId} |
| | | </foreach> |
| | | LEFT JOIN platform_file_user t2 ON t1.file_Id = t2.file_Id |
| | | WHERE |
| | | 1 =1 |
| | | <if test="userId!=null"> |
| | | AND |
| | | t2.user_id = #{userId} |
| | | </if> |
| | | </where> |
| | | <if test="keyword != null and keyword != ''"> |
| | | AND ( |
| | | t1.file_name LIKE CONCAT('%', #{keyword},'%') |
| | | ) |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | if (platformFiles == null && platformFiles.size() == 0) { |
| | | throw new BusinessException("未找到文件!"); |
| | | } |
| | | |
| | | //获取关系 |
| | | List<PlatformFileUser> list = platformFileUserService.list(Wrappers.lambdaQuery(PlatformFileUser.class).in(PlatformFileUser::getFileId, param.getFileIds())); |
| | | if (!list.isEmpty()) { |
| | | //删除关系 |
| | | boolean remove = platformFileUserService.remove(Wrappers.lambdaQuery(PlatformFileUser.class).in(PlatformFileUser::getFileId, param.getFileIds())); |
| | | if (remove) { |
| | | platformFileUserService.remove(Wrappers.lambdaQuery(PlatformFileUser.class).in(PlatformFileUser::getFileId, param.getFileIds())); |
| | | } |
| | | //删除文件 |
| | | return removeByIds(param.getFileIds()); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |