Переглянути джерело

Merge remote-tracking branch 'origin/dev/icss' into dev/icss

Zhaops 6 роки тому
батько
коміт
38cb6c05c3

+ 3 - 0
icss-service/src/main/java/com/diagbot/vo/RetrievalVO.java

@@ -4,6 +4,7 @@ import lombok.Getter;
 import lombok.Setter;
 
 import javax.validation.constraints.NotNull;
+import java.util.List;
 
 /**
  * @Description:
@@ -22,4 +23,6 @@ public class RetrievalVO {
     private String InputStr;
     @NotNull(message = "请输入病人性别")
     private Integer sexType;
+    //需要去重的id
+    private List<Long> inputIds;
 }

+ 2 - 1
icss-service/src/main/java/com/diagbot/web/RetrievalController.java

@@ -37,7 +37,8 @@ public class RetrievalController {
             notes = "type:类型(1:症状 3:其他史 4:查体,5:化验 6:辅检 7:诊断),必填<br>" +
                     "age:年龄,必填<br>" +
                     "inputStr:检索内容,必填<br>" +
-                    "sexType:性别,必填<br>")
+                    "sexType:性别,必填<br>" +
+                    "inputIds:需要去重的id")
     @PostMapping("/getTagInfos")
     @SysLogger("getTagInfos")
     public RespDTO<List<RetrievalDTO>> getTagInfos(@Valid @RequestBody RetrievalVO retrievalVO) {

+ 18 - 0
icss-service/src/main/resources/mapper/RetrievalMapper.xml

@@ -32,6 +32,12 @@
         <if test="sexType != 3">
             and c.sex_type in ('3',#{sexType})
         </if>
+        <if test="inputIds != null and inputIds.size > 0">
+            and c.id not in
+            <foreach item="id" collection="inputIds" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </if>
         UNION
         SELECT a.`name` as retrieval_name,c.id as question_id,b.show_type FROM icss_retrieval a
         LEFT JOIN icss_retrieval_mapping b ON a.id = b.retrieval_id
@@ -49,6 +55,12 @@
         <if test="sexType != 3">
             and c.sex_type in ('3',#{sexType})
         </if>
+        <if test="inputIds != null and inputIds.size > 0">
+            and c.id not in
+            <foreach item="id" collection="inputIds" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </if>
         UNION
         SELECT a.`name` as retrieval_name,c.id as question_id,b.show_type FROM icss_retrieval a
         LEFT JOIN icss_retrieval_mapping b ON a.id = b.retrieval_id
@@ -66,5 +78,11 @@
         <if test="sexType != 3">
             and c.sex_type in ('3',#{sexType})
         </if>
+        <if test="inputIds != null and inputIds.size > 0">
+            and c.id not in
+            <foreach item="id" collection="inputIds" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </if>
     </select>
 </mapper>