Browse Source

元数据

“zhifk” 2 năm trước cách đây
mục cha
commit
cf6af3bedb

+ 5 - 1
blade-service/blade-business/src/main/java/org/springblade/business/controller/MetadataController.java

@@ -73,7 +73,11 @@ public class MetadataController extends BladeController {
     @ApiOperation(value = "元数据容器分类详情", notes = "传入分类类型")
     public R<IPage<MetadataClassification>> allocationDetail(@ApiIgnore @RequestParam String fileStorage, Query query) {
         QueryWrapper<MetadataClassification> metadata = new QueryWrapper<>();
-        metadata.lambda().ne(MetadataClassification :: getFileStorageType,fileStorage).eq(MetadataClassification::getIsDeleted,0);
+        if(fileStorage.isEmpty() || fileStorage.equals("0")){
+            metadata.lambda().eq(MetadataClassification::getIsDeleted,0);
+        }else{
+            metadata.lambda().notLike(MetadataClassification :: getFileStorageType,fileStorage).eq(MetadataClassification::getIsDeleted,0);
+        }
         IPage<MetadataClassification> page = iMetadataClassificationService.page(Condition.getPage(query), metadata);
         return R.data(page);
     }

+ 5 - 1
blade-service/blade-business/src/main/java/org/springblade/business/mapper/MetadataClassificationMapper.xml

@@ -73,6 +73,10 @@
 
     <update id="updateMetadataBytype">
         update u_metadata_classification set file_storage_type = CONCAT(file_storage_type, ',', #{type})
-        where id in(${ids}) and locate(#{type},file_storage_type) = 0
+        where id in
+        <foreach collection="ids" item="ids" index="ids" open="(" separator="," close=")">
+            ${ids}
+        </foreach>
+        and locate(#{type},file_storage_type) = 0
     </update>
 </mapper>

+ 7 - 2
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/MetadataClassificationServiceImpl.java

@@ -90,7 +90,12 @@ public class MetadataClassificationServiceImpl
 
     @Override
     public boolean updateMetadataBytype(List<Long> ids, String type) {
-        baseMapper.updateMetadataBytype(ids,type);
-        return false;
+        try {
+            baseMapper.updateMetadataBytype(ids,type);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+        return true;
     }
 }