Selaa lähdekoodia

拜城公安,媒体库

lyhzzz 10 kuukautta sitten
vanhempi
commit
413010dd81

+ 3 - 2
src/main/java/com/fdkankan/fusion/controller/CaseFilesTypeController.java

@@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 /**
@@ -25,8 +26,8 @@ public class CaseFilesTypeController {
     ICaseFilesTypeService caseFilesTypeService;
 
     @GetMapping("/allList")
-    public ResultData allList(){
-        return ResultData.ok(caseFilesTypeService.list());
+    public ResultData allList(@RequestParam(required = false,defaultValue = "file")String fileTypeKey){
+        return ResultData.ok(caseFilesTypeService.listByTypeKey(fileTypeKey));
     }
 }
 

+ 12 - 0
src/main/java/com/fdkankan/fusion/entity/CaseFilesType.java

@@ -37,6 +37,18 @@ public class CaseFilesType implements Serializable {
     @TableField("files_type_name")
     private String filesTypeName;
 
+    /**
+     * 附件类型名称
+     */
+    @TableField("files_type_key")
+    private String filesTypeKey;
+
+    /**
+     * 附件类型名称
+     */
+    @TableField("sort")
+    private Integer sort;
+
     @TableField("tb_status")
     @TableLogic
     private Integer tbStatus;

+ 3 - 0
src/main/java/com/fdkankan/fusion/service/ICaseFilesTypeService.java

@@ -3,6 +3,8 @@ package com.fdkankan.fusion.service;
 import com.fdkankan.fusion.entity.CaseFilesType;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * <p>
  *  服务类
@@ -13,4 +15,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface ICaseFilesTypeService extends IService<CaseFilesType> {
 
+    List<CaseFilesType> listByTypeKey(String fileTypeKey);
 }

+ 10 - 0
src/main/java/com/fdkankan/fusion/service/impl/CaseFilesTypeServiceImpl.java

@@ -1,11 +1,14 @@
 package com.fdkankan.fusion.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.fdkankan.fusion.entity.CaseFilesType;
 import com.fdkankan.fusion.mapper.ICaseFilesTypeMapper;
 import com.fdkankan.fusion.service.ICaseFilesTypeService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * <p>
  *  服务实现类
@@ -17,4 +20,11 @@ import org.springframework.stereotype.Service;
 @Service
 public class CaseFilesTypeServiceImpl extends ServiceImpl<ICaseFilesTypeMapper, CaseFilesType> implements ICaseFilesTypeService {
 
+    @Override
+    public List<CaseFilesType> listByTypeKey(String fileTypeKey) {
+        LambdaQueryWrapper<CaseFilesType> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CaseFilesType::getFilesTypeKey,fileTypeKey);
+        wrapper.orderByAsc(CaseFilesType::getSort);
+        return this.list(wrapper);
+    }
 }