Procházet zdrojové kódy

门诊诊断补录添加权重

lighter před 3 roky
rodič
revize
80228ab3ef

+ 5 - 0
src/main/java/thyyxxk/webserver/controller/yibao/DictionaryController.java

@@ -32,6 +32,11 @@ public class DictionaryController {
         return service.executeSearch(param);
     }
 
+    @PostMapping("/increaseWeight")
+    public ResultVo<String> increaseWeight(@RequestBody PureCodeName data) {
+        return service.increaseWeight(data);
+    }
+
     @GetMapping("/getAllSpecialDiags")
     public ResultVo<List<SpecialDiag>> getAllSpecialDiags(@RequestParam("medType") String medType) {
         return service.getAllSpecialDiags(medType);

+ 5 - 1
src/main/java/thyyxxk/webserver/dao/his/yibao/DictionaryDao.java

@@ -3,6 +3,7 @@ package thyyxxk.webserver.dao.his.yibao;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
 import thyyxxk.webserver.entity.dictionary.PureCodeName;
 import thyyxxk.webserver.entity.medicalinsurance.inpatient.SpecialDiag;
 
@@ -16,9 +17,12 @@ public interface DictionaryDao {
     List<PureCodeName> searchPhysician(@Param("method") String method, @Param("content") String content);
 
     @Select("select diagnosis_code as code, diagnosis_name as name from t_si_dl_dss_dns " +
-            "where ${method} LIKE #{content} collate Chinese_PRC_CI_AS")
+            "where ${method} LIKE #{content} collate Chinese_PRC_CI_AS order by weight desc")
     List<PureCodeName> searchDiagnose(@Param("method") String method, @Param("content") String content);
 
+    @Update("update t_si_dl_dss_dns set weight=(weight+1) where diagnosis_code=#{code}")
+    void increaseWeight(@Param("code") String code);
+
     @Select("select distinct new_code as code,new_name as name from ${tableName} where new_name like #{content} collate Chinese_PRC_CI_AS")
     List<PureCodeName> selectSlwSpcDiag(@Param("content") String content, @Param("tableName") String tableName);
 

+ 7 - 0
src/main/java/thyyxxk/webserver/service/yibao/DictionaryService.java

@@ -28,6 +28,13 @@ public class DictionaryService {
         this.dao = dao;
     }
 
+    public ResultVo<String> increaseWeight(PureCodeName data) {
+        if (data.getCode().equals("diag")) {
+            dao.increaseWeight(data.getName());
+        }
+        return ResultVoUtil.success();
+    }
+
     public ResultVo<List<PureCodeName>> executeSearch(SearchDataParam param) {
         switch (param.getTarget()) {
             case "physician":