|
@@ -421,7 +421,7 @@
|
|
FROM
|
|
FROM
|
|
(
|
|
(
|
|
-- 除化验外其他类型标签
|
|
-- 除化验外其他类型标签
|
|
- <if test="typesNoLis != null and typesNoLis.size() > 0">
|
|
|
|
|
|
+ <if test="typesIn != null and typesIn.size() > 0">
|
|
(
|
|
(
|
|
SELECT
|
|
SELECT
|
|
b1.*, 0 uniqueId,
|
|
b1.*, 0 uniqueId,
|
|
@@ -466,7 +466,7 @@
|
|
AND t6.is_deleted = 'N'
|
|
AND t6.is_deleted = 'N'
|
|
AND t7.is_deleted = 'N'
|
|
AND t7.is_deleted = 'N'
|
|
AND t1.lib_type IN
|
|
AND t1.lib_type IN
|
|
- <foreach collection="typesNoLis" item="item" open="(" close=")"
|
|
|
|
|
|
+ <foreach collection="typesIn" item="item" open="(" close=")"
|
|
separator=",">
|
|
separator=",">
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
@@ -521,7 +521,7 @@
|
|
AND t6.is_deleted = 'N'
|
|
AND t6.is_deleted = 'N'
|
|
AND t7.is_deleted = 'N'
|
|
AND t7.is_deleted = 'N'
|
|
AND t1.lib_type IN
|
|
AND t1.lib_type IN
|
|
- <foreach collection="typesNoLis" item="item" open="(" close=")"
|
|
|
|
|
|
+ <foreach collection="typesIn" item="item" open="(" close=")"
|
|
separator=",">
|
|
separator=",">
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
@@ -576,7 +576,7 @@
|
|
AND t6.is_deleted = 'N'
|
|
AND t6.is_deleted = 'N'
|
|
AND t7.is_deleted = 'N'
|
|
AND t7.is_deleted = 'N'
|
|
AND t1.lib_type IN
|
|
AND t1.lib_type IN
|
|
- <foreach collection="typesNoLis" item="item" open="(" close=")"
|
|
|
|
|
|
+ <foreach collection="typesIn" item="item" open="(" close=")"
|
|
separator=",">
|
|
separator=",">
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
@@ -588,7 +588,7 @@
|
|
)
|
|
)
|
|
</if>
|
|
</if>
|
|
-- 化验本体标签公表项匹配静态知识
|
|
-- 化验本体标签公表项匹配静态知识
|
|
- <if test="typesNoLis != null and typesNoLis.size() > 0 and hasLis == true">
|
|
|
|
|
|
+ <if test="typesIn != null and typesIn.size() > 0 and hasLis == true">
|
|
UNION
|
|
UNION
|
|
</if>
|
|
</if>
|
|
<if test="hasLis == true">
|
|
<if test="hasLis == true">
|
|
@@ -1066,6 +1066,179 @@
|
|
AND b2.id = b3.concept_id
|
|
AND b2.id = b3.concept_id
|
|
)
|
|
)
|
|
</if>
|
|
</if>
|
|
|
|
+
|
|
|
|
+ -- 量表匹配静态知识,如果只有量表,也同时搜索诊断有关的量表;如果还有其他类型,不搜索诊断相关的量表
|
|
|
|
+ <if test="hasGauge == true">
|
|
|
|
+ <if test="typesIn != null and typesIn.size() > 0 || hasLis == true">
|
|
|
|
+ union
|
|
|
|
+ </if>
|
|
|
|
+ (
|
|
|
|
+ SELECT
|
|
|
|
+ b1.selfId conceptId,
|
|
|
|
+ b1.selfName `name`,
|
|
|
|
+ 71 AS orderNo,
|
|
|
|
+ b1.retrievalName retrievalName,
|
|
|
|
+ b1.showType showType,
|
|
|
|
+ b1.libTypeId libTypeId,
|
|
|
|
+ b1.libTypeName libTypeName,
|
|
|
|
+ b1.selfId uniqueId,
|
|
|
|
+ b1.selfName uniqueName
|
|
|
|
+ FROM
|
|
|
|
+ (
|
|
|
|
+ SELECT
|
|
|
|
+ t1.id selfId,
|
|
|
|
+ t1.lib_name selfName,
|
|
|
|
+ t2.`name` retrievalName,
|
|
|
|
+ t2.is_concept showType,
|
|
|
|
+ t1.lib_type libTypeId,
|
|
|
|
+ t6.`name` libTypeName
|
|
|
|
+ FROM
|
|
|
|
+ kl_concept t1
|
|
|
|
+ LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
|
|
|
|
+ LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
|
|
|
|
+ WHERE
|
|
|
|
+ t1.is_deleted = 'N'
|
|
|
|
+ AND t2.is_deleted = 'N'
|
|
|
|
+ AND t6.is_deleted = 'N'
|
|
|
|
+ AND t1.lib_type = 48
|
|
|
|
+ AND (
|
|
|
|
+ UPPER(t2.spell) = UPPER(TRIM(#{InputStr}))
|
|
|
|
+ OR UPPER(t2. NAME) = UPPER(TRIM(#{InputStr}))
|
|
|
|
+ )
|
|
|
|
+ ) b1,
|
|
|
|
+ kl_scale b2
|
|
|
|
+ WHERE
|
|
|
|
+ b2.is_deleted = 'N'
|
|
|
|
+ AND b1.selfId = b2.concept_id
|
|
|
|
+ )
|
|
|
|
+ UNION
|
|
|
|
+ (
|
|
|
|
+ SELECT
|
|
|
|
+ b1.selfId conceptId,
|
|
|
|
+ b1.selfName `name`,
|
|
|
|
+ 72 AS orderNo,
|
|
|
|
+ b1.retrievalName retrievalName,
|
|
|
|
+ b1.showType showType,
|
|
|
|
+ b1.libTypeId libTypeId,
|
|
|
|
+ b1.libTypeName libTypeName,
|
|
|
|
+ b1.selfId uniqueId,
|
|
|
|
+ b1.selfName uniqueName
|
|
|
|
+ FROM
|
|
|
|
+ (
|
|
|
|
+ SELECT
|
|
|
|
+ t1.id selfId,
|
|
|
|
+ t1.lib_name selfName,
|
|
|
|
+ t2.`name` retrievalName,
|
|
|
|
+ t2.is_concept showType,
|
|
|
|
+ t1.lib_type libTypeId,
|
|
|
|
+ t6.`name` libTypeName
|
|
|
|
+ FROM
|
|
|
|
+ kl_concept t1
|
|
|
|
+ LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
|
|
|
|
+ LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
|
|
|
|
+ WHERE
|
|
|
|
+ t1.is_deleted = 'N'
|
|
|
|
+ AND t2.is_deleted = 'N'
|
|
|
|
+ AND t6.is_deleted = 'N'
|
|
|
|
+ AND t1.lib_type = 48
|
|
|
|
+ AND (
|
|
|
|
+ UPPER(t2.spell) LIKE CONCAT(UPPER(TRIM(#{InputStr})), '%')
|
|
|
|
+ OR UPPER(t2. NAME) LIKE CONCAT(UPPER(TRIM(#{InputStr})), '%')
|
|
|
|
+ )
|
|
|
|
+ ) b1,
|
|
|
|
+ kl_scale b2
|
|
|
|
+ WHERE
|
|
|
|
+ b2.is_deleted = 'N'
|
|
|
|
+ AND b1.selfId = b2.concept_id
|
|
|
|
+ )
|
|
|
|
+ UNION
|
|
|
|
+ (
|
|
|
|
+ SELECT
|
|
|
|
+ b1.selfId conceptId,
|
|
|
|
+ b1.selfName `name`,
|
|
|
|
+ 73 AS orderNo,
|
|
|
|
+ b1.retrievalName retrievalName,
|
|
|
|
+ b1.showType showType,
|
|
|
|
+ b1.libTypeId libTypeId,
|
|
|
|
+ b1.libTypeName libTypeName,
|
|
|
|
+ b1.selfId uniqueId,
|
|
|
|
+ b1.selfName uniqueName
|
|
|
|
+ FROM
|
|
|
|
+ (
|
|
|
|
+ SELECT
|
|
|
|
+ t1.id selfId,
|
|
|
|
+ t1.lib_name selfName,
|
|
|
|
+ t2.`name` retrievalName,
|
|
|
|
+ t2.is_concept showType,
|
|
|
|
+ t1.lib_type libTypeId,
|
|
|
|
+ t6.`name` libTypeName
|
|
|
|
+ FROM
|
|
|
|
+ kl_concept t1
|
|
|
|
+ LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
|
|
|
|
+ LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
|
|
|
|
+ WHERE
|
|
|
|
+ t1.is_deleted = 'N'
|
|
|
|
+ AND t2.is_deleted = 'N'
|
|
|
|
+ AND t6.is_deleted = 'N'
|
|
|
|
+ AND t1.lib_type = 48
|
|
|
|
+ AND (
|
|
|
|
+ UPPER(t2.spell) LIKE CONCAT('%', UPPER(TRIM(#{InputStr})), '%')
|
|
|
|
+ OR UPPER(t2. NAME) LIKE CONCAT('%',UPPER(TRIM(#{InputStr})), '%')
|
|
|
|
+ )
|
|
|
|
+ ) b1
|
|
|
|
+ ,kl_scale b2
|
|
|
|
+ WHERE
|
|
|
|
+ b2.is_deleted = 'N'
|
|
|
|
+ AND b1.selfId = b2.concept_id
|
|
|
|
+ )
|
|
|
|
+ </if>
|
|
|
|
+
|
|
|
|
+ -- 只有量表时还需要根据诊断去查询量表
|
|
|
|
+ <if test="onlyGauge">
|
|
|
|
+ UNION
|
|
|
|
+ SELECT distinct
|
|
|
|
+ b2.id conceptId,
|
|
|
|
+ b2.lib_name `name`,
|
|
|
|
+ 74 AS orderNo,
|
|
|
|
+ b1.retrievalName retrievalName,
|
|
|
|
+ 0 showType,
|
|
|
|
+ b2.lib_type libTypeId,
|
|
|
|
+ '量表' libTypeName,
|
|
|
|
+ b2.id uniqueId,
|
|
|
|
+ b2.lib_name uniqueName
|
|
|
|
+ FROM
|
|
|
|
+ (
|
|
|
|
+ SELECT
|
|
|
|
+ t1.id selfId,
|
|
|
|
+ t1.lib_name selfName,
|
|
|
|
+ t2.`name` retrievalName,
|
|
|
|
+ t2.is_concept showType,
|
|
|
|
+ t1.lib_type libTypeId,
|
|
|
|
+ t6.`name` libTypeName
|
|
|
|
+ FROM
|
|
|
|
+ kl_concept t1
|
|
|
|
+ LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
|
|
|
|
+ LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
|
|
|
|
+ WHERE
|
|
|
|
+ t1.is_deleted = 'N'
|
|
|
|
+ AND t2.is_deleted = 'N'
|
|
|
|
+ AND t6.is_deleted = 'N'
|
|
|
|
+ AND t1.lib_type = 18
|
|
|
|
+ AND (
|
|
|
|
+ UPPER(t2.spell) = UPPER(TRIM(#{InputStr}))
|
|
|
|
+ OR UPPER(t2. NAME) = UPPER(TRIM(#{InputStr}))
|
|
|
|
+ )
|
|
|
|
+ ) b1
|
|
|
|
+ , kl_concept b2, kl_relation b3, kl_scale b4
|
|
|
|
+ WHERE
|
|
|
|
+ b2.is_deleted = 'N'
|
|
|
|
+ AND b3.is_deleted = 'N'
|
|
|
|
+ AND b4.is_deleted = 'N'
|
|
|
|
+ AND b1.selfId = b3.start_id
|
|
|
|
+ AND b2.id = b3.end_id
|
|
|
|
+ AND b2.id = b4.concept_id
|
|
|
|
+ </if>
|
|
|
|
+
|
|
) a1
|
|
) a1
|
|
ORDER BY
|
|
ORDER BY
|
|
a1.orderNo ASC,
|
|
a1.orderNo ASC,
|
|
@@ -1110,7 +1283,9 @@
|
|
SELECT DISTINCT b.id concept_id,b.lib_name name FROM `kl_library_info` a, kl_concept b
|
|
SELECT DISTINCT b.id concept_id,b.lib_name name FROM `kl_library_info` a, kl_concept b
|
|
where a.is_deleted = 'N' and b.is_deleted = 'N'
|
|
where a.is_deleted = 'N' and b.is_deleted = 'N'
|
|
and a.concept_id = b.id
|
|
and a.concept_id = b.id
|
|
- and UPPER(TRIM(a.`name`)) like concat('%',UPPER(TRIM(#{name})),'%') and a.type_id = #{libType} and b.lib_type = #{libType}
|
|
|
|
|
|
+ and (UPPER(TRIM(a.`name`)) like concat('%',UPPER(TRIM(#{name})),'%')
|
|
|
|
+ or UPPER(TRIM(a.`spell`)) like concat('%',UPPER(TRIM(#{name})),'%'))
|
|
|
|
+ and a.type_id = #{libType} and b.lib_type = #{libType}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
</mapper>
|
|
</mapper>
|