|
@@ -69,8 +69,13 @@
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
|
- distinct
|
|
|
- s.*,
|
|
|
+ s.id,
|
|
|
+ s.name,
|
|
|
+ s.retrievalName,
|
|
|
+ s.isConcept,
|
|
|
+ s.type,
|
|
|
+ s.typeName,
|
|
|
+ group_concat(distinct s.code SEPARATOR '') as code,
|
|
|
s1.concept_id AS conceptId,
|
|
|
s1.clinical_pathway_name AS clinicalPathwayName,
|
|
|
s1.notice_name AS noticeName,
|
|
@@ -84,7 +89,7 @@
|
|
|
t.isConcept,
|
|
|
t.type,
|
|
|
t.typeName,
|
|
|
- l1.icd10_code AS code
|
|
|
+ '' AS code
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
@@ -112,14 +117,11 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
) t
|
|
|
- LEFT JOIN kl_disease l1 ON t.id = l1.concept_id
|
|
|
- AND l1.is_deleted = 'N'
|
|
|
WHERE
|
|
|
1=1
|
|
|
<if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
|
|
|
AND ( t.retrievalName = #{staticKnowledgeIndexPageVO.inputStr}
|
|
|
- OR LOWER(t.spell) = LOWER(#{staticKnowledgeIndexPageVO.inputStr})
|
|
|
- OR LOWER(l1.icd10_code) = LOWER(#{staticKnowledgeIndexPageVO.inputStr}))
|
|
|
+ OR LOWER(t.spell) = LOWER(#{staticKnowledgeIndexPageVO.inputStr}))
|
|
|
</if>
|
|
|
UNION
|
|
|
SELECT
|
|
@@ -129,7 +131,7 @@
|
|
|
t.isConcept,
|
|
|
t.type,
|
|
|
t.typeName,
|
|
|
- l1.icd10_code AS code
|
|
|
+ '' AS code
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
@@ -157,14 +159,11 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
) t
|
|
|
- LEFT JOIN kl_disease l1 ON t.id = l1.concept_id
|
|
|
- AND l1.is_deleted = 'N'
|
|
|
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},'%'))
|
|
|
- OR LOWER(l1.icd10_code) LIKE LOWER( concat(#{staticKnowledgeIndexPageVO.inputStr},'%')))
|
|
|
+ OR LOWER(t.spell) LIKE LOWER( concat(#{staticKnowledgeIndexPageVO.inputStr},'%')))
|
|
|
</if>
|
|
|
UNION
|
|
|
SELECT
|
|
@@ -174,7 +173,7 @@
|
|
|
t.isConcept,
|
|
|
t.type,
|
|
|
t.typeName,
|
|
|
- l1.icd10_code AS code
|
|
|
+ '' AS code
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
@@ -202,16 +201,13 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
) t
|
|
|
- LEFT JOIN kl_disease l1 ON t.id = l1.concept_id
|
|
|
- AND l1.is_deleted = 'N'
|
|
|
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},'%'))
|
|
|
- OR LOWER(l1.icd10_code) LIKE LOWER( concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%')))
|
|
|
+ OR LOWER(t.spell) LIKE LOWER( concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%')))
|
|
|
</if>
|
|
|
- <if test="(staticKnowledgeIndexPageVO.types != null and staticKnowledgeIndexPageVO.types.size > 0 and (staticKnowledgeIndexPageVO.types.contains(0) or staticKnowledgeIndexPageVO.types.contains(3))) or staticKnowledgeIndexPageVO.types==null or staticKnowledgeIndexPageVO.types.size==0">
|
|
|
+ <if test="staticKnowledgeIndexPageVO.typeIds.contains(107) or staticKnowledgeIndexPageVO.typeIds.contains(108)">
|
|
|
UNION
|
|
|
SELECT DISTINCT
|
|
|
e.id AS id,
|
|
@@ -309,6 +305,125 @@
|
|
|
AND ( a.name LIKE concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%') OR LOWER(a.spell) LIKE LOWER( concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%')))
|
|
|
</if>
|
|
|
</if>
|
|
|
+ <if test="staticKnowledgeIndexPageVO.typeIds.contains(100) ">
|
|
|
+ UNION
|
|
|
+ SELECT
|
|
|
+ t.id,
|
|
|
+ t.NAME,
|
|
|
+ IF ( t.isConcept = 0, t.retrievalName, '' ) AS retrievalName,
|
|
|
+ t.isConcept,
|
|
|
+ t.type,
|
|
|
+ t.typeName,
|
|
|
+ l1.icd10_code AS code
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ a.NAME AS retrievalName,
|
|
|
+ a.spell AS spell,
|
|
|
+ a.is_concept AS isConcept,
|
|
|
+ b.id AS id,
|
|
|
+ b.lib_name AS NAME,
|
|
|
+ b.lib_type AS type,
|
|
|
+ c.NAME AS typeName
|
|
|
+ FROM
|
|
|
+ kl_library_info a,
|
|
|
+ kl_concept b,
|
|
|
+ kl_lexicon c
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND b.is_deleted = 'N'
|
|
|
+ AND c.is_deleted = 'N'
|
|
|
+ AND a.concept_id = b.id
|
|
|
+ AND b.lib_type = c.code
|
|
|
+ AND b.`status` = 1
|
|
|
+ AND a.type_id =100
|
|
|
+ ) t
|
|
|
+ LEFT JOIN kl_disease l1 ON t.id = l1.concept_id
|
|
|
+ AND l1.is_deleted = 'N'
|
|
|
+ WHERE
|
|
|
+ 1=1
|
|
|
+ <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
|
|
|
+ AND LOWER(l1.icd10_code) = LOWER(#{staticKnowledgeIndexPageVO.inputStr})
|
|
|
+ </if>
|
|
|
+ UNION
|
|
|
+ SELECT
|
|
|
+ t.id,
|
|
|
+ t.NAME,
|
|
|
+ IF ( t.isConcept = 0, t.retrievalName, '' ) AS retrievalName,
|
|
|
+ t.isConcept,
|
|
|
+ t.type,
|
|
|
+ t.typeName,
|
|
|
+ l1.icd10_code AS code
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ a.NAME AS retrievalName,
|
|
|
+ a.spell AS spell,
|
|
|
+ a.is_concept AS isConcept,
|
|
|
+ b.id AS id,
|
|
|
+ b.lib_name AS NAME,
|
|
|
+ b.lib_type AS type,
|
|
|
+ c.NAME AS typeName
|
|
|
+ FROM
|
|
|
+ kl_library_info a,
|
|
|
+ kl_concept b,
|
|
|
+ kl_lexicon c
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND b.is_deleted = 'N'
|
|
|
+ AND c.is_deleted = 'N'
|
|
|
+ AND a.concept_id = b.id
|
|
|
+ AND b.lib_type = c.code
|
|
|
+ AND b.`status` = 1
|
|
|
+ AND a.type_id =100
|
|
|
+ ) t
|
|
|
+ LEFT JOIN kl_disease l1 ON t.id = l1.concept_id
|
|
|
+ AND l1.is_deleted = 'N'
|
|
|
+ WHERE
|
|
|
+ 1=1
|
|
|
+ <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
|
|
|
+ AND LOWER(l1.icd10_code) LIKE LOWER( concat(#{staticKnowledgeIndexPageVO.inputStr},'%'))
|
|
|
+ </if>
|
|
|
+ UNION
|
|
|
+ SELECT
|
|
|
+ t.id,
|
|
|
+ t.NAME,
|
|
|
+ IF ( t.isConcept = 0, t.retrievalName, '' ) AS retrievalName,
|
|
|
+ t.isConcept,
|
|
|
+ t.type,
|
|
|
+ t.typeName,
|
|
|
+ l1.icd10_code AS code
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ a.NAME AS retrievalName,
|
|
|
+ a.spell AS spell,
|
|
|
+ a.is_concept AS isConcept,
|
|
|
+ b.id AS id,
|
|
|
+ b.lib_name AS NAME,
|
|
|
+ b.lib_type AS type,
|
|
|
+ c.NAME AS typeName
|
|
|
+ FROM
|
|
|
+ kl_library_info a,
|
|
|
+ kl_concept b,
|
|
|
+ kl_lexicon c
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND b.is_deleted = 'N'
|
|
|
+ AND c.is_deleted = 'N'
|
|
|
+ AND a.concept_id = b.id
|
|
|
+ AND b.lib_type = c.code
|
|
|
+ AND b.`status` = 1
|
|
|
+ AND a.type_id =100
|
|
|
+ ) t
|
|
|
+ LEFT JOIN kl_disease l1 ON t.id = l1.concept_id
|
|
|
+ AND l1.is_deleted = 'N'
|
|
|
+ WHERE
|
|
|
+ 1=1
|
|
|
+ <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
|
|
|
+ AND LOWER(l1.icd10_code) LIKE LOWER( concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%'))
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
) s,
|
|
|
kl_concept_static s1
|
|
|
WHERE s.id = s1.concept_id
|