瀏覽代碼

静态知识检索

zhaops 4 年之前
父節點
當前提交
5fac0deff3
共有 2 個文件被更改,包括 31 次插入43 次删除
  1. 18 24
      src/main/resources/mapper/KlConceptMapper.xml
  2. 13 19
      src/main/resources/mapper/KlConceptStaticMapper.xml

+ 18 - 24
src/main/resources/mapper/KlConceptMapper.xml

@@ -176,7 +176,7 @@
 		t.isConcept,
 		t.type,
 		t.typeName,
-		'' AS code
+        t1.icd10_code AS code
 		FROM
 		(
 		SELECT
@@ -203,13 +203,11 @@
 				a.type_id =#{typeId}
 			</foreach>
 		</if>
-		) t
-		WHERE
-		1=1
-		<if test="inputStr!=null and inputStr!=''">
-			AND ( t.retrievalName = #{inputStr}
-			OR LOWER(t.spell) = LOWER(#{inputStr}))
-		</if>
+        <if test="inputStr!=null and inputStr!=''">
+            AND ( a.name = #{inputStr}
+            OR LOWER(a.spell) = LOWER(#{inputStr}))
+        </if>
+		) t left join kl_disease t1 on t.id = t1.concept_id and t1.is_deleted='N'
 		UNION
 		SELECT
 		t.id,
@@ -218,7 +216,7 @@
 		t.isConcept,
 		t.type,
 		t.typeName,
-		'' AS code
+        t1.icd10_code AS code
 		FROM
 		(
 		SELECT
@@ -245,13 +243,11 @@
 				a.type_id =#{typeId}
 			</foreach>
 		</if>
-		) t
-		WHERE
-		1=1
-		<if test="inputStr!=null and inputStr!=''">
-			AND ( t.retrievalName LIKE concat(#{inputStr},'%')
-			OR LOWER(t.spell) LIKE LOWER( concat(#{inputStr},'%')))
-		</if>
+        <if test="inputStr!=null and inputStr!=''">
+            AND ( a.name LIKE concat(#{inputStr},'%')
+            OR LOWER(a.spell) LIKE LOWER( concat(#{inputStr},'%')))
+        </if>
+		) t left join kl_disease t1 on t.id = t1.concept_id and t1.is_deleted='N'
 		UNION
 		SELECT
 		t.id,
@@ -260,7 +256,7 @@
 		t.isConcept,
 		t.type,
 		t.typeName,
-		'' AS code
+        t1.icd10_code AS code
 		FROM
 		(
 		SELECT
@@ -287,13 +283,11 @@
 				a.type_id =#{typeId}
 			</foreach>
 		</if>
-		) t
-		WHERE
-		1=1
-		<if test="inputStr!=null and inputStr!=''">
-			AND ( t.retrievalName LIKE concat('%',#{inputStr},'%')
-			OR LOWER(t.spell) LIKE LOWER( concat('%',#{inputStr},'%')))
-		</if>
+        <if test="inputStr!=null and inputStr!=''">
+            AND ( a.name LIKE concat('%',#{inputStr},'%')
+            OR LOWER(a.spell) LIKE LOWER( concat('%',#{inputStr},'%')))
+        </if>
+		) t left join kl_disease t1 on t.id = t1.concept_id and t1.is_deleted='N'
 		<if test="typeIds.contains(107) or typeIds.contains(108)">
 			UNION
 			SELECT DISTINCT

+ 13 - 19
src/main/resources/mapper/KlConceptStaticMapper.xml

@@ -75,7 +75,7 @@
         s.isConcept,
         s.type,
         s.typeName,
-        group_concat(distinct s.code SEPARATOR '') as code,
+        s.code,
         s1.concept_id AS conceptId,
         s1.clinical_pathway_name AS clinicalPathwayName,
         s1.notice_name AS noticeName,
@@ -89,7 +89,7 @@
         t.isConcept,
         t.type,
         t.typeName,
-        '' AS code
+        t1.icd10_code AS code
         FROM
         (
         SELECT
@@ -116,13 +116,11 @@
                 a.type_id =#{typeId}
             </foreach>
         </if>
-        ) t
-        WHERE
-        1=1
         <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
-            AND ( t.retrievalName = #{staticKnowledgeIndexPageVO.inputStr}
-            OR LOWER(t.spell) = LOWER(#{staticKnowledgeIndexPageVO.inputStr}))
+            AND ( a.name = #{staticKnowledgeIndexPageVO.inputStr}
+            OR LOWER(a.spell) = LOWER(#{staticKnowledgeIndexPageVO.inputStr}))
         </if>
+        ) t left join kl_disease t1 on t.id = t1.concept_id and t1.is_deleted='N'
         UNION
         SELECT
         t.id,
@@ -131,7 +129,7 @@
         t.isConcept,
         t.type,
         t.typeName,
-        '' AS code
+        t1.icd10_code AS code
         FROM
         (
         SELECT
@@ -158,13 +156,11 @@
                 a.type_id =#{typeId}
             </foreach>
         </if>
-        ) t
-        WHERE
-        1=1
         <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
-            AND ( t.retrievalName LIKE concat(#{staticKnowledgeIndexPageVO.inputStr},'%')
-            OR LOWER(t.spell) LIKE LOWER( concat(#{staticKnowledgeIndexPageVO.inputStr},'%')))
+            AND ( a.name LIKE concat(#{staticKnowledgeIndexPageVO.inputStr},'%')
+            OR LOWER(a.spell) LIKE LOWER( concat(#{staticKnowledgeIndexPageVO.inputStr},'%')))
         </if>
+        ) t left join kl_disease t1 on t.id = t1.concept_id and t1.is_deleted='N'
         UNION
         SELECT
         t.id,
@@ -173,7 +169,7 @@
         t.isConcept,
         t.type,
         t.typeName,
-        '' AS code
+        t1.icd10_code AS code
         FROM
         (
         SELECT
@@ -200,13 +196,11 @@
                 a.type_id =#{typeId}
             </foreach>
         </if>
-        ) t
-        WHERE
-        1=1
         <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
-            AND ( t.retrievalName LIKE concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%')
-            OR LOWER(t.spell) LIKE LOWER( concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%')))
+            AND ( a.name LIKE concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%')
+            OR LOWER(a.spell) LIKE LOWER( concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%')))
         </if>
+        ) t left join kl_disease t1 on t.id = t1.concept_id and t1.is_deleted='N'
         <if test="staticKnowledgeIndexPageVO.typeIds.contains(107) or staticKnowledgeIndexPageVO.typeIds.contains(108)">
             UNION
             SELECT DISTINCT