|
@@ -222,7 +222,7 @@
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- AND (t2.spell = UPPER(#{InputStr}) OR t2.name = #{InputStr})
|
|
|
+ AND (UPPER(t2.spell) = UPPER(TRIM(#{InputStr})) OR UPPER(t2.name) = UPPER(TRIM(#{InputStr})))
|
|
|
LIMIT 100)
|
|
|
UNION
|
|
|
(SELECT t1.id selfId,t1.lib_name selfName,0 parentId,null parentName,t2.`name` sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
|
|
@@ -259,7 +259,7 @@
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- AND (t2.spell LIKE CONCAT( UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT( #{InputStr},'%'))
|
|
|
+ AND (UPPER(t2.spell) LIKE CONCAT( UPPER(TRIM(#{InputStr})),'%') OR UPPER(t2.name) LIKE CONCAT( UPPER(TRIM(#{InputStr})),'%'))
|
|
|
LIMIT 100)
|
|
|
UNION
|
|
|
(SELECT t1.id selfId,t1.lib_name selfName,0 parentId,null parentName,t2.`name` sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
|
|
@@ -296,7 +296,7 @@
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- AND (t2.spell LIKE CONCAT('%',UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT('%',#{InputStr},'%'))
|
|
|
+ AND (UPPER(t2.spell) LIKE CONCAT('%',UPPER(TRIM(#{InputStr})),'%') OR UPPER(t2.name) LIKE CONCAT('%',UPPER(TRIM(#{InputStr})),'%'))
|
|
|
LIMIT 100)
|
|
|
<if test="detailType != null and detailType != ''">
|
|
|
UNION
|
|
@@ -326,7 +326,7 @@
|
|
|
AND <![CDATA[ t3.min_age <= #{age} ]]>
|
|
|
AND <![CDATA[ t3.max_age >= #{age} ]]>
|
|
|
</if>
|
|
|
- AND (t2.spell = UPPER(#{InputStr}) OR t2.name = #{InputStr})
|
|
|
+ AND (UPPER(t2.spell) = UPPER(TRIM(#{InputStr})) OR UPPER(t2.name) = UPPER(TRIM(#{InputStr})))
|
|
|
<if test="inputIds != null and inputIds.size > 0">
|
|
|
and t1.id not in
|
|
|
<foreach item="id" collection="inputIds" open="(" separator="," close=")">
|
|
@@ -362,7 +362,7 @@
|
|
|
AND <![CDATA[ t3.min_age <= #{age} ]]>
|
|
|
AND <![CDATA[ t3.max_age >= #{age} ]]>
|
|
|
</if>
|
|
|
- AND (t2.spell LIKE CONCAT(UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT( #{InputStr},'%'))
|
|
|
+ AND (UPPER(t2.spell) LIKE CONCAT(UPPER(TRIM(#{InputStr})),'%') OR UPPER(t2.name) LIKE CONCAT( UPPER(TRIM(#{InputStr})),'%'))
|
|
|
<if test="inputIds != null and inputIds.size > 0">
|
|
|
and t1.id not in
|
|
|
<foreach item="id" collection="inputIds" open="(" separator="," close=")">
|
|
@@ -401,7 +401,7 @@
|
|
|
AND <![CDATA[ t3.min_age <= #{age} ]]>
|
|
|
AND <![CDATA[ t3.max_age >= #{age} ]]>
|
|
|
</if>
|
|
|
- AND (t2.spell LIKE CONCAT('%',UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT('%',#{InputStr},'%'))
|
|
|
+ AND (UPPER(t2.spell) LIKE CONCAT('%',UPPER(TRIM(#{InputStr})),'%') OR UPPER(t2.name) LIKE CONCAT('%',UPPER(TRIM(#{InputStr})),'%'))
|
|
|
<if test="inputIds != null and inputIds.size > 0">
|
|
|
and t1.id not in
|
|
|
<foreach item="id" collection="inputIds" open="(" separator="," close=")">
|
|
@@ -421,6 +421,7 @@
|
|
|
FROM
|
|
|
(
|
|
|
-- 除化验外其他类型标签
|
|
|
+ <if test="typesIn != null and typesIn.size() > 0">
|
|
|
(
|
|
|
SELECT
|
|
|
b1.*, 0 uniqueId,
|
|
@@ -436,30 +437,42 @@
|
|
|
10
|
|
|
WHEN 10 THEN
|
|
|
20
|
|
|
- ELSE
|
|
|
+ WHEN 1 THEN
|
|
|
+ 25
|
|
|
+ WHEN 16 THEN
|
|
|
50
|
|
|
+ WHEN 25 THEN
|
|
|
+ 60
|
|
|
+ ELSE
|
|
|
+ 100
|
|
|
END
|
|
|
) + 1 AS orderNo,
|
|
|
t2.`name` retrievalName,
|
|
|
t2.is_concept showType,
|
|
|
t1.lib_type libTypeId,
|
|
|
- t6.`name` libTypeName
|
|
|
+ CASE t6.`name`
|
|
|
+ when '药品通用名' then '药品'
|
|
|
+ when '辅检项目' then '辅检'
|
|
|
+ ELSE t6.`name`
|
|
|
+ END libTypeName
|
|
|
FROM
|
|
|
kl_concept t1
|
|
|
LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
|
|
|
- LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
|
|
|
LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
|
|
|
LEFT JOIN kl_concept_detail t7 ON t7.concept_id = t1.id
|
|
|
WHERE
|
|
|
t1.is_deleted = 'N'
|
|
|
AND t2.is_deleted = 'N'
|
|
|
- AND t3.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
AND t7.is_deleted = 'N'
|
|
|
- AND t1.lib_type IN (18, 10, 16)
|
|
|
+ AND t1.lib_type IN
|
|
|
+ <foreach collection="typesIn" item="item" open="(" close=")"
|
|
|
+ separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
AND (
|
|
|
- t2.spell = UPPER(#{InputStr})
|
|
|
- OR t2. NAME = (#{InputStr})
|
|
|
+ UPPER(t2.spell) = UPPER(TRIM(#{InputStr}))
|
|
|
+ OR UPPER(TRIM(t2. NAME)) = UPPER((TRIM(#{InputStr})))
|
|
|
)
|
|
|
) b1
|
|
|
)
|
|
@@ -479,30 +492,42 @@
|
|
|
10
|
|
|
WHEN 10 THEN
|
|
|
20
|
|
|
- ELSE
|
|
|
+ WHEN 1 THEN
|
|
|
+ 25
|
|
|
+ WHEN 16 THEN
|
|
|
50
|
|
|
+ WHEN 25 THEN
|
|
|
+ 60
|
|
|
+ ELSE
|
|
|
+ 100
|
|
|
END
|
|
|
) + 2 AS orderNo,
|
|
|
t2.`name` retrievalName,
|
|
|
t2.is_concept showType,
|
|
|
t1.lib_type libTypeId,
|
|
|
- t6.`name` libTypeName
|
|
|
+ CASE t6.`name`
|
|
|
+ when '药品通用名' then '药品'
|
|
|
+ when '辅检项目' then '辅检'
|
|
|
+ ELSE t6.`name`
|
|
|
+ END libTypeName
|
|
|
FROM
|
|
|
kl_concept t1
|
|
|
LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
|
|
|
- LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
|
|
|
LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
|
|
|
LEFT JOIN kl_concept_detail t7 ON t7.concept_id = t1.id
|
|
|
WHERE
|
|
|
t1.is_deleted = 'N'
|
|
|
AND t2.is_deleted = 'N'
|
|
|
- AND t3.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
AND t7.is_deleted = 'N'
|
|
|
- AND t1.lib_type IN (18, 10, 16)
|
|
|
+ AND t1.lib_type IN
|
|
|
+ <foreach collection="typesIn" item="item" open="(" close=")"
|
|
|
+ separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
AND (
|
|
|
- t2.spell LIKE CONCAT(UPPER(#{InputStr}), '%')
|
|
|
- OR t2. NAME LIKE CONCAT((#{InputStr}), '%')
|
|
|
+ UPPER(t2.spell) LIKE CONCAT(UPPER(TRIM(#{InputStr})), '%')
|
|
|
+ OR UPPER(t2. NAME) LIKE CONCAT(UPPER(TRIM(#{InputStr})), '%')
|
|
|
)
|
|
|
) b1
|
|
|
)
|
|
@@ -522,34 +547,51 @@
|
|
|
10
|
|
|
WHEN 10 THEN
|
|
|
20
|
|
|
- ELSE
|
|
|
+ WHEN 1 THEN
|
|
|
+ 25
|
|
|
+ WHEN 16 THEN
|
|
|
50
|
|
|
+ WHEN 25 THEN
|
|
|
+ 60
|
|
|
+ ELSE
|
|
|
+ 100
|
|
|
END
|
|
|
) + 3 AS orderNo,
|
|
|
t2.`name` retrievalName,
|
|
|
t2.is_concept showType,
|
|
|
t1.lib_type libTypeId,
|
|
|
- t6.`name` libTypeName
|
|
|
+ CASE t6.`name`
|
|
|
+ when '药品通用名' then '药品'
|
|
|
+ when '辅检项目' then '辅检'
|
|
|
+ ELSE t6.`name`
|
|
|
+ END libTypeName
|
|
|
FROM
|
|
|
kl_concept t1
|
|
|
LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
|
|
|
- LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
|
|
|
LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
|
|
|
LEFT JOIN kl_concept_detail t7 ON t7.concept_id = t1.id
|
|
|
WHERE
|
|
|
t1.is_deleted = 'N'
|
|
|
AND t2.is_deleted = 'N'
|
|
|
- AND t3.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
AND t7.is_deleted = 'N'
|
|
|
- AND t1.lib_type IN (18, 10, 16)
|
|
|
+ AND t1.lib_type IN
|
|
|
+ <foreach collection="typesIn" item="item" open="(" close=")"
|
|
|
+ separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
AND (
|
|
|
- t2.spell LIKE CONCAT('%', UPPER(#{InputStr}), '%')
|
|
|
- OR t2. NAME LIKE CONCAT('%',(#{InputStr}), '%')
|
|
|
+ UPPER(t2.spell) LIKE CONCAT('%', UPPER(TRIM(#{InputStr})), '%')
|
|
|
+ OR UPPER(t2. NAME) LIKE CONCAT('%',UPPER(TRIM(#{InputStr})), '%')
|
|
|
)
|
|
|
) b1
|
|
|
- ) -- 化验本体标签公表项匹配静态知识
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ -- 化验本体标签公表项匹配静态知识
|
|
|
+ <if test="typesIn != null and typesIn.size() > 0 and hasLis == true">
|
|
|
UNION
|
|
|
+ </if>
|
|
|
+ <if test="hasLis == true">
|
|
|
(
|
|
|
SELECT
|
|
|
b2.id conceptId,
|
|
@@ -573,17 +615,15 @@
|
|
|
FROM
|
|
|
kl_concept t1
|
|
|
LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
|
|
|
- LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
|
|
|
LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
|
|
|
WHERE
|
|
|
t1.is_deleted = 'N'
|
|
|
AND t2.is_deleted = 'N'
|
|
|
- AND t3.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
AND t1.lib_type = 12
|
|
|
AND (
|
|
|
- t2.spell = UPPER(#{InputStr})
|
|
|
- OR t2. NAME = (#{InputStr})
|
|
|
+ UPPER(t2.spell) = UPPER(TRIM(#{InputStr}))
|
|
|
+ OR UPPER(t2. NAME) = UPPER(TRIM(#{InputStr}))
|
|
|
)
|
|
|
) b1,
|
|
|
kl_concept b2,
|
|
@@ -623,17 +663,15 @@
|
|
|
FROM
|
|
|
kl_concept t1
|
|
|
LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
|
|
|
- LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
|
|
|
LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
|
|
|
WHERE
|
|
|
t1.is_deleted = 'N'
|
|
|
AND t2.is_deleted = 'N'
|
|
|
- AND t3.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
AND t1.lib_type = 12
|
|
|
AND (
|
|
|
- t2.spell LIKE CONCAT(UPPER(#{InputStr}), '%')
|
|
|
- OR t2. NAME LIKE CONCAT((#{InputStr}), '%')
|
|
|
+ UPPER(t2.spell) LIKE CONCAT(UPPER(TRIM(#{InputStr})), '%')
|
|
|
+ OR UPPER(t2. NAME) LIKE CONCAT(UPPER(TRIM(#{InputStr})), '%')
|
|
|
)
|
|
|
) b1,
|
|
|
kl_concept b2,
|
|
@@ -673,17 +711,15 @@
|
|
|
FROM
|
|
|
kl_concept t1
|
|
|
LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
|
|
|
- LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
|
|
|
LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
|
|
|
WHERE
|
|
|
t1.is_deleted = 'N'
|
|
|
AND t2.is_deleted = 'N'
|
|
|
- AND t3.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
AND t1.lib_type = 12
|
|
|
AND (
|
|
|
- t2.spell LIKE CONCAT('%', UPPER(#{InputStr}), '%')
|
|
|
- OR t2. NAME LIKE CONCAT('%',(#{InputStr}), '%')
|
|
|
+ UPPER(t2.spell) LIKE CONCAT('%', UPPER(TRIM(#{InputStr})), '%')
|
|
|
+ OR UPPER(t2. NAME) LIKE CONCAT('%',UPPER(TRIM(#{InputStr})), '%')
|
|
|
)
|
|
|
) b1,
|
|
|
kl_concept b2,
|
|
@@ -728,18 +764,16 @@
|
|
|
LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
|
|
|
LEFT JOIN kl_concept t5 ON t5.id = t4.start_id
|
|
|
LEFT JOIN kl_lexicon t6 ON t6.id = t5.lib_type
|
|
|
- LEFT JOIN kl_concept_common t3 ON t5.id = t3.concept_id
|
|
|
WHERE
|
|
|
t1.is_deleted = 'N'
|
|
|
AND t2.is_deleted = 'N'
|
|
|
- AND t3.is_deleted = 'N'
|
|
|
AND t4.is_deleted = 'N'
|
|
|
AND t5.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
AND t1.lib_type = 13
|
|
|
AND (
|
|
|
- t2.spell = UPPER(#{InputStr})
|
|
|
- OR t2. NAME = #{InputStr}
|
|
|
+ UPPER(t2.spell) = UPPER(TRIM(#{InputStr}))
|
|
|
+ OR UPPER(t2. NAME) = UPPER(TRIM(#{InputStr}))
|
|
|
)
|
|
|
AND t4.relation_id = 18
|
|
|
) b1,
|
|
@@ -785,18 +819,16 @@
|
|
|
LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
|
|
|
LEFT JOIN kl_concept t5 ON t5.id = t4.start_id
|
|
|
LEFT JOIN kl_lexicon t6 ON t6.id = t5.lib_type
|
|
|
- LEFT JOIN kl_concept_common t3 ON t5.id = t3.concept_id
|
|
|
WHERE
|
|
|
t1.is_deleted = 'N'
|
|
|
AND t2.is_deleted = 'N'
|
|
|
- AND t3.is_deleted = 'N'
|
|
|
AND t4.is_deleted = 'N'
|
|
|
AND t5.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
AND t1.lib_type = 13
|
|
|
AND (
|
|
|
- t2.spell LIKE CONCAT(UPPER(#{InputStr}), '%')
|
|
|
- OR t2. NAME LIKE CONCAT(#{InputStr}, '%')
|
|
|
+ UPPER(t2.spell) LIKE CONCAT(UPPER(TRIM(#{InputStr})), '%')
|
|
|
+ OR UPPER(t2. NAME) LIKE CONCAT(UPPER(TRIM(#{InputStr})), '%')
|
|
|
)
|
|
|
AND t4.relation_id = 18
|
|
|
) b1,
|
|
@@ -842,18 +874,16 @@
|
|
|
LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
|
|
|
LEFT JOIN kl_concept t5 ON t5.id = t4.start_id
|
|
|
LEFT JOIN kl_lexicon t6 ON t6.id = t5.lib_type
|
|
|
- LEFT JOIN kl_concept_common t3 ON t5.id = t3.concept_id
|
|
|
WHERE
|
|
|
t1.is_deleted = 'N'
|
|
|
AND t2.is_deleted = 'N'
|
|
|
- AND t3.is_deleted = 'N'
|
|
|
AND t4.is_deleted = 'N'
|
|
|
AND t5.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
AND t1.lib_type = 13
|
|
|
AND (
|
|
|
- t2.spell LIKE CONCAT('%', UPPER(#{InputStr}), '%')
|
|
|
- OR t2. NAME LIKE CONCAT('%', #{InputStr}, '%')
|
|
|
+ UPPER(t2.spell) LIKE CONCAT('%', UPPER(TRIM(#{InputStr})), '%')
|
|
|
+ OR UPPER(t2. NAME) LIKE CONCAT('%', UPPER(TRIM(#{InputStr})), '%')
|
|
|
)
|
|
|
AND t4.relation_id = 18
|
|
|
) b1,
|
|
@@ -899,18 +929,16 @@
|
|
|
LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
|
|
|
LEFT JOIN kl_concept t5 ON t5.id = t4.start_id
|
|
|
LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
|
|
|
- LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
|
|
|
WHERE
|
|
|
t1.is_deleted = 'N'
|
|
|
AND t2.is_deleted = 'N'
|
|
|
- AND t3.is_deleted = 'N'
|
|
|
AND t4.is_deleted = 'N'
|
|
|
AND t5.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
AND t1.lib_type = 13
|
|
|
AND (
|
|
|
- t2.spell = UPPER(#{InputStr})
|
|
|
- OR t2. NAME = #{InputStr}
|
|
|
+ UPPER(t2.spell) = UPPER(TRIM(#{InputStr}))
|
|
|
+ OR UPPER(t2. NAME) = UPPER(TRIM(#{InputStr}))
|
|
|
)
|
|
|
AND t4.relation_id = 18
|
|
|
) b1,
|
|
@@ -956,18 +984,16 @@
|
|
|
LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
|
|
|
LEFT JOIN kl_concept t5 ON t5.id = t4.start_id
|
|
|
LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
|
|
|
- LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
|
|
|
WHERE
|
|
|
t1.is_deleted = 'N'
|
|
|
AND t2.is_deleted = 'N'
|
|
|
- AND t3.is_deleted = 'N'
|
|
|
AND t4.is_deleted = 'N'
|
|
|
AND t5.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
AND t1.lib_type = 13
|
|
|
AND (
|
|
|
- t2.spell LIKE CONCAT(UPPER(#{InputStr}), '%')
|
|
|
- OR t2. NAME LIKE CONCAT(#{InputStr}, '%')
|
|
|
+ UPPER(t2.spell) LIKE CONCAT(UPPER(TRIM(#{InputStr})), '%')
|
|
|
+ OR UPPER(t2. NAME) LIKE CONCAT(UPPER(TRIM(#{InputStr})), '%')
|
|
|
)
|
|
|
AND t4.relation_id = 18
|
|
|
) b1,
|
|
@@ -1013,18 +1039,16 @@
|
|
|
LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
|
|
|
LEFT JOIN kl_concept t5 ON t5.id = t4.start_id
|
|
|
LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
|
|
|
- LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
|
|
|
WHERE
|
|
|
t1.is_deleted = 'N'
|
|
|
AND t2.is_deleted = 'N'
|
|
|
- AND t3.is_deleted = 'N'
|
|
|
AND t4.is_deleted = 'N'
|
|
|
AND t5.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
AND t1.lib_type = 13
|
|
|
AND (
|
|
|
- t2.spell LIKE CONCAT('%', UPPER(#{InputStr}), '%')
|
|
|
- OR t2. NAME LIKE CONCAT('%', #{InputStr}, '%')
|
|
|
+ UPPER(t2.spell) LIKE CONCAT('%', UPPER(TRIM(#{InputStr})), '%')
|
|
|
+ OR UPPER(t2. NAME) LIKE CONCAT('%', UPPER(TRIM(#{InputStr})), '%')
|
|
|
)
|
|
|
AND t4.relation_id = 18
|
|
|
) b1,
|
|
@@ -1041,6 +1065,180 @@
|
|
|
AND b2.lib_type = 46
|
|
|
AND b2.id = b3.concept_id
|
|
|
)
|
|
|
+ </if>
|
|
|
+
|
|
|
+ -- 量表匹配静态知识同时搜索诊断有关的量表;
|
|
|
+ <if test="hasGauge == true">
|
|
|
+ <if test="typesIn != null and typesIn.size() > 0 or 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
|
|
|
+ )
|
|
|
+
|
|
|
+
|
|
|
+ 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
|
|
|
ORDER BY
|
|
|
a1.orderNo ASC,
|
|
@@ -1085,7 +1283,9 @@
|
|
|
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'
|
|
|
and a.concept_id = b.id
|
|
|
- and a.`name` like concat('%',#{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>
|
|
|
|
|
|
</mapper>
|