|
@@ -298,7 +298,7 @@
|
|
|
</if>
|
|
|
AND (t2.spell LIKE CONCAT('%',UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT('%',#{InputStr},'%'))
|
|
|
LIMIT 100)
|
|
|
- <if test="detilType != null and detilType != ''">
|
|
|
+ <if test="detailType != null and detailType != ''">
|
|
|
UNION
|
|
|
(SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t5.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
|
|
|
LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
|
|
@@ -313,8 +313,8 @@
|
|
|
AND t4.is_deleted = 'N'
|
|
|
AND t5.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
- <if test="detilType != null">
|
|
|
- AND t1.lib_type = #{detilType}
|
|
|
+ <if test="detailType != null">
|
|
|
+ AND t1.lib_type = #{detailType}
|
|
|
</if>
|
|
|
<if test="sexType == 3">
|
|
|
and t3.sex_type in ('1','2','3')
|
|
@@ -349,8 +349,8 @@
|
|
|
AND t4.is_deleted = 'N'
|
|
|
AND t5.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
- <if test="detilType != null">
|
|
|
- AND t1.lib_type = #{detilType}
|
|
|
+ <if test="detailType != null">
|
|
|
+ AND t1.lib_type = #{detailType}
|
|
|
</if>
|
|
|
<if test="sexType == 3">
|
|
|
and t3.sex_type in ('1','2','3')
|
|
@@ -388,8 +388,8 @@
|
|
|
AND t4.is_deleted = 'N'
|
|
|
AND t5.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
- <if test="detilType != null">
|
|
|
- AND t1.lib_type = #{detilType}
|
|
|
+ <if test="detailType != null">
|
|
|
+ AND t1.lib_type = #{detailType}
|
|
|
</if>
|
|
|
<if test="sexType == 3">
|
|
|
and t3.sex_type in ('1','2','3')
|
|
@@ -416,82 +416,74 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="staticKnowledge" resultType="com.diagbot.dto.ConceptRetrievalDTO">
|
|
|
- SELECT a1.* from (
|
|
|
- (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
|
|
|
+ -- 除化验外其他类型标签
|
|
|
+ (SELECT b1.*,0 uniqueId,null uniqueName
|
|
|
+ FROM (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
|
|
|
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'
|
|
|
- <if test="type != null">
|
|
|
- AND t1.lib_type = #{type}
|
|
|
- </if>
|
|
|
+ AND t7.is_deleted = 'N'
|
|
|
<if test="otherType != null and otherType.size > 0">
|
|
|
- and t1.lib_type in
|
|
|
+ AND t1.lib_type in
|
|
|
<foreach item="type" collection="otherType" open="(" separator="," close=")">
|
|
|
#{type}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="sexType == 3">
|
|
|
- and t3.sex_type in ('1','2','3')
|
|
|
- </if>
|
|
|
- <if test="sexType != 3">
|
|
|
- and t3.sex_type in ('3',#{sexType})
|
|
|
- </if>
|
|
|
- <if test="age != null and age != ''">
|
|
|
- AND <![CDATA[ t3.min_age <= #{age} ]]>
|
|
|
- AND <![CDATA[ t3.max_age >= #{age} ]]>
|
|
|
- </if>
|
|
|
- <if test="inputIds != null and inputIds.size > 0">
|
|
|
- and t1.id not in
|
|
|
- <foreach item="id" collection="inputIds" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- AND (t2.spell = UPPER(#{InputStr}) OR t2.name = #{InputStr})
|
|
|
- GROUP BY t1.id
|
|
|
+ AND (t2.spell = UPPER(#{InputStr}) OR t2.name = (#{InputStr}))
|
|
|
+ GROUP BY t1.id) b1)
|
|
|
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
|
|
|
+ (SELECT b1.*,0 uniqueId,null uniqueName
|
|
|
+ FROM (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
|
|
|
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'
|
|
|
- <if test="type != null">
|
|
|
- AND t1.lib_type = #{type}
|
|
|
- </if>
|
|
|
+ AND t7.is_deleted = 'N'
|
|
|
<if test="otherType != null and otherType.size > 0">
|
|
|
- and t1.lib_type in
|
|
|
+ AND t1.lib_type in
|
|
|
<foreach item="type" collection="otherType" open="(" separator="," close=")">
|
|
|
#{type}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="sexType == 3">
|
|
|
- and t3.sex_type in ('1','2','3')
|
|
|
- </if>
|
|
|
- <if test="sexType != 3">
|
|
|
- and t3.sex_type in ('3',#{sexType})
|
|
|
- </if>
|
|
|
- <if test="age != null and age != ''">
|
|
|
- AND <![CDATA[ t3.min_age <= #{age} ]]>
|
|
|
- AND <![CDATA[ t3.max_age >= #{age} ]]>
|
|
|
- </if>
|
|
|
- <if test="inputIds != null and inputIds.size > 0">
|
|
|
- and t1.id not in
|
|
|
- <foreach item="id" collection="inputIds" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- AND (t2.spell LIKE CONCAT( UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT( #{InputStr},'%'))
|
|
|
- GROUP BY t1.id
|
|
|
+ AND (t2.spell LIKE CONCAT(UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT((#{InputStr}),'%'))
|
|
|
+ GROUP BY t1.id) b1)
|
|
|
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
|
|
|
+ (SELECT b1.*,0 uniqueId,null uniqueName
|
|
|
+ FROM (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
|
|
|
+ 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'
|
|
|
+ <if test="otherType != null and otherType.size > 0">
|
|
|
+ AND t1.lib_type in
|
|
|
+ <foreach item="type" collection="otherType" open="(" separator="," close=")">
|
|
|
+ #{type}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ AND (t2.spell LIKE CONCAT('%',UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT('%',(#{InputStr}),'%'))
|
|
|
+ GROUP BY t1.id) b1)
|
|
|
+
|
|
|
+ -- 化验本体标签公表项匹配静态知识
|
|
|
+ UNION
|
|
|
+ (SELECT b1.*,b2.id uniqueId,b2.lib_name uniqueName
|
|
|
+ FROM (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
|
|
|
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
|
|
@@ -500,258 +492,218 @@
|
|
|
AND t2.is_deleted = 'N'
|
|
|
AND t3.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
- <if test="type != null">
|
|
|
- AND t1.lib_type = #{type}
|
|
|
- </if>
|
|
|
- <if test="otherType != null and otherType.size > 0">
|
|
|
- and t1.lib_type in
|
|
|
- <foreach item="type" collection="otherType" open="(" separator="," close=")">
|
|
|
- #{type}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="sexType == 3">
|
|
|
- and t3.sex_type in ('1','2','3')
|
|
|
- </if>
|
|
|
- <if test="sexType != 3">
|
|
|
- and t3.sex_type in ('3',#{sexType})
|
|
|
- </if>
|
|
|
- <if test="age != null and age != ''">
|
|
|
- AND <![CDATA[ t3.min_age <= #{age} ]]>
|
|
|
- AND <![CDATA[ t3.max_age >= #{age} ]]>
|
|
|
- </if>
|
|
|
- <if test="inputIds != null and inputIds.size > 0">
|
|
|
- and t1.id not in
|
|
|
- <foreach item="id" collection="inputIds" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- AND (t2.spell LIKE CONCAT('%',UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT('%',#{InputStr},'%'))
|
|
|
- GROUP BY t1.id
|
|
|
- <if test="detilType != null and detilType != ''">
|
|
|
- UNION
|
|
|
- (SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,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_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 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'
|
|
|
- <if test="detilType != null">
|
|
|
- AND t1.lib_type = #{detilType}
|
|
|
- </if>
|
|
|
- <if test="sexType == 3">
|
|
|
- and t3.sex_type in ('1','2','3')
|
|
|
- </if>
|
|
|
- <if test="sexType != 3">
|
|
|
- and t3.sex_type in ('3',#{sexType})
|
|
|
- </if>
|
|
|
- <if test="age != null and age != ''">
|
|
|
- AND <![CDATA[ t3.min_age <= #{age} ]]>
|
|
|
- AND <![CDATA[ t3.max_age >= #{age} ]]>
|
|
|
- </if>
|
|
|
- AND (t2.spell = UPPER(#{InputStr}) OR t2.name = #{InputStr})
|
|
|
- <if test="inputIds != null and inputIds.size > 0">
|
|
|
- and t1.id not in
|
|
|
- <foreach item="id" collection="inputIds" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- AND t4.relation_id = 18
|
|
|
- GROUP BY t5.id
|
|
|
- UNION
|
|
|
- (SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,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_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 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'
|
|
|
- <if test="detilType != null">
|
|
|
- AND t1.lib_type = #{detilType}
|
|
|
- </if>
|
|
|
- <if test="sexType == 3">
|
|
|
- and t3.sex_type in ('1','2','3')
|
|
|
- </if>
|
|
|
- <if test="sexType != 3">
|
|
|
- and t3.sex_type in ('3',#{sexType})
|
|
|
- </if>
|
|
|
- <if test="age != null and age != ''">
|
|
|
- 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},'%'))
|
|
|
- <if test="inputIds != null and inputIds.size > 0">
|
|
|
- and t1.id not in
|
|
|
- <foreach item="id" collection="inputIds" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- AND t4.relation_id = 18
|
|
|
- GROUP BY t5.id
|
|
|
- UNION
|
|
|
- (SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,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_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 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'
|
|
|
- <if test="detilType != null">
|
|
|
- AND t1.lib_type = #{detilType}
|
|
|
- </if>
|
|
|
- <if test="sexType == 3">
|
|
|
- and t3.sex_type in ('1','2','3')
|
|
|
- </if>
|
|
|
- <if test="sexType != 3">
|
|
|
- and t3.sex_type in ('3',#{sexType})
|
|
|
- </if>
|
|
|
- <if test="age != null and age != ''">
|
|
|
- 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},'%'))
|
|
|
- <if test="inputIds != null and inputIds.size > 0">
|
|
|
- and t1.id not in
|
|
|
- <foreach item="id" collection="inputIds" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- AND t4.relation_id = 18
|
|
|
- GROUP BY t5.id
|
|
|
- </if>
|
|
|
- UNION
|
|
|
- (SELECT 0 selfId,null selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t5.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_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'
|
|
|
- <if test="detilType != null">
|
|
|
- AND t1.lib_type = #{detilType}
|
|
|
- </if>
|
|
|
- <if test="sexType == 3">
|
|
|
- and t3.sex_type in ('1','2','3')
|
|
|
- </if>
|
|
|
- <if test="sexType != 3">
|
|
|
- and t3.sex_type in ('3',#{sexType})
|
|
|
- </if>
|
|
|
- <if test="age != null and age != ''">
|
|
|
- AND <![CDATA[ t3.min_age <= #{age} ]]>
|
|
|
- AND <![CDATA[ t3.max_age >= #{age} ]]>
|
|
|
- </if>
|
|
|
- AND (t2.spell = UPPER(#{InputStr}) OR t2.name = #{InputStr})
|
|
|
- <if test="inputIds != null and inputIds.size > 0">
|
|
|
- and t1.id not in
|
|
|
- <foreach item="id" collection="inputIds" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- AND t4.relation_id = 18
|
|
|
- GROUP BY t5.id
|
|
|
- UNION
|
|
|
- (SELECT 0 selfId,null selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t5.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_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'
|
|
|
- <if test="detilType != null">
|
|
|
- AND t1.lib_type = #{detilType}
|
|
|
- </if>
|
|
|
- <if test="sexType == 3">
|
|
|
- and t3.sex_type in ('1','2','3')
|
|
|
- </if>
|
|
|
- <if test="sexType != 3">
|
|
|
- and t3.sex_type in ('3',#{sexType})
|
|
|
- </if>
|
|
|
- <if test="age != null and age != ''">
|
|
|
- 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},'%'))
|
|
|
- <if test="inputIds != null and inputIds.size > 0">
|
|
|
- and t1.id not in
|
|
|
- <foreach item="id" collection="inputIds" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- AND t4.relation_id = 18
|
|
|
- GROUP BY t5.id
|
|
|
- UNION
|
|
|
- (SELECT 0 selfId,null selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t5.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_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'
|
|
|
- <if test="detilType != null">
|
|
|
- AND t1.lib_type = #{detilType}
|
|
|
- </if>
|
|
|
- <if test="sexType == 3">
|
|
|
- and t3.sex_type in ('1','2','3')
|
|
|
- </if>
|
|
|
- <if test="sexType != 3">
|
|
|
- and t3.sex_type in ('3',#{sexType})
|
|
|
- </if>
|
|
|
- <if test="age != null and age != ''">
|
|
|
- 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},'%'))
|
|
|
- <if test="inputIds != null and inputIds.size > 0">
|
|
|
- and t1.id not in
|
|
|
- <foreach item="id" collection="inputIds" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- AND t4.relation_id = 18
|
|
|
- GROUP BY t5.id
|
|
|
- ) a1
|
|
|
+ AND t1.lib_type = #{type}
|
|
|
+ AND (t2.spell = UPPER(#{InputStr}) OR t2.name = (#{InputStr}))
|
|
|
+ GROUP BY t1.id) b1,
|
|
|
+ kl_concept b2,
|
|
|
+ kl_concept_detail b3
|
|
|
+ WHERE b2.is_deleted = 'N'
|
|
|
+ and b3.is_deleted = 'N'
|
|
|
+ and b1.selfName = b2.lib_name
|
|
|
+ and b2.lib_type = 46
|
|
|
+ and b2.id = b3.concept_id)
|
|
|
+ UNION
|
|
|
+ (SELECT b1.*,b2.id uniqueId,b2.lib_name uniqueName
|
|
|
+ FROM (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
|
|
|
+ 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 = #{type}
|
|
|
+ AND (t2.spell LIKE CONCAT(UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT((#{InputStr}),'%'))
|
|
|
+ GROUP BY t1.id) b1,
|
|
|
+ kl_concept b2,
|
|
|
+ kl_concept_detail b3
|
|
|
+ WHERE b2.is_deleted = 'N'
|
|
|
+ and b3.is_deleted = 'N'
|
|
|
+ and b1.selfName = b2.lib_name
|
|
|
+ and b2.lib_type = 46
|
|
|
+ and b2.id = b3.concept_id)
|
|
|
+ UNION
|
|
|
+ (SELECT b1.*,b2.id uniqueId,b2.lib_name uniqueName
|
|
|
+ FROM (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
|
|
|
+ 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 = #{type}
|
|
|
+ AND (t2.spell LIKE CONCAT('%',UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT('%',(#{InputStr}),'%'))
|
|
|
+ GROUP BY t1.id) b1,
|
|
|
+ kl_concept b2,
|
|
|
+ kl_concept_detail b3
|
|
|
+ WHERE b2.is_deleted = 'N'
|
|
|
+ and b3.is_deleted = 'N'
|
|
|
+ and b1.selfName = b2.lib_name
|
|
|
+ and b2.lib_type = 46
|
|
|
+ and b2.id = b3.concept_id)
|
|
|
+
|
|
|
+ -- 化验子项推父项,父项公表项匹配静态知识
|
|
|
+ UNION
|
|
|
+ (SELECT b1.*,b2.id uniqueId,b2.lib_name uniqueName
|
|
|
+ FROM (SELECT 0 selfId,null selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t5.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_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 = #{detailType}
|
|
|
+ AND (t2.spell = UPPER(#{InputStr}) OR t2.name = #{InputStr})
|
|
|
+ AND t4.relation_id = 18
|
|
|
+ GROUP BY t5.id) b1,
|
|
|
+ kl_concept b2,
|
|
|
+ kl_concept_detail b3
|
|
|
+ WHERE b2.is_deleted = 'N'
|
|
|
+ and b3.is_deleted = 'N'
|
|
|
+ and b1.parentName = b2.lib_name
|
|
|
+ and b2.lib_type = 46
|
|
|
+ and b2.id = b3.concept_id)
|
|
|
+ UNION
|
|
|
+ (SELECT b1.*,b2.id uniqueId,b2.lib_name uniqueName
|
|
|
+ FROM (SELECT 0 selfId,null selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t5.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_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 = #{detailType}
|
|
|
+ AND (t2.spell LIKE CONCAT(UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT(#{InputStr},'%'))
|
|
|
+ AND t4.relation_id = 18
|
|
|
+ GROUP BY t5.id) b1,
|
|
|
+ kl_concept b2,
|
|
|
+ kl_concept_detail b3
|
|
|
+ WHERE b2.is_deleted = 'N'
|
|
|
+ and b3.is_deleted = 'N'
|
|
|
+ and b1.parentName = b2.lib_name
|
|
|
+ and b2.lib_type = 46
|
|
|
+ and b2.id = b3.concept_id)
|
|
|
+ UNION
|
|
|
+ (SELECT b1.*,b2.id uniqueId,b2.lib_name uniqueName
|
|
|
+ FROM (SELECT 0 selfId,null selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t5.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_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 = #{detailType}
|
|
|
+ AND (t2.spell LIKE CONCAT('%',UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT('%',#{InputStr},'%'))
|
|
|
+ AND t4.relation_id = 18
|
|
|
+ GROUP BY t5.id) b1,
|
|
|
+ kl_concept b2,
|
|
|
+ kl_concept_detail b3
|
|
|
+ WHERE b2.is_deleted = 'N'
|
|
|
+ and b3.is_deleted = 'N'
|
|
|
+ and b1.parentName = b2.lib_name
|
|
|
+ and b2.lib_type = 46
|
|
|
+ and b2.id = b3.concept_id)
|
|
|
+
|
|
|
+ -- 化验子项推父项,父项--子项组合公表项匹配静态知识
|
|
|
+ UNION
|
|
|
+ (SELECT b1.*,b2.id uniqueId,b2.lib_name uniqueName
|
|
|
+ FROM (SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,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_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 = #{detailType}
|
|
|
+ AND (t2.spell = UPPER(#{InputStr}) OR t2.name = #{InputStr})
|
|
|
+ AND t4.relation_id = 18
|
|
|
+ GROUP BY t5.id) b1,
|
|
|
+ kl_concept b2,
|
|
|
+ kl_concept_detail b3
|
|
|
+ WHERE b2.is_deleted = 'N'
|
|
|
+ and b3.is_deleted = 'N'
|
|
|
+ and CONCAT(b1.parentName,'--',b1.selfName) = b2.lib_name
|
|
|
+ and b2.lib_type = 46
|
|
|
+ and b2.id = b3.concept_id)
|
|
|
+ UNION
|
|
|
+ (SELECT b1.*,b2.id uniqueId,b2.lib_name uniqueName
|
|
|
+ FROM (SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,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_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 = #{detailType}
|
|
|
+ AND (t2.spell LIKE CONCAT(UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT(#{InputStr},'%'))
|
|
|
+ AND t4.relation_id = 18
|
|
|
+ GROUP BY t5.id) b1,
|
|
|
+ kl_concept b2,
|
|
|
+ kl_concept_detail b3
|
|
|
+ WHERE b2.is_deleted = 'N'
|
|
|
+ and b3.is_deleted = 'N'
|
|
|
+ and CONCAT(b1.parentName,'--',b1.selfName) = b2.lib_name
|
|
|
+ and b2.lib_type = 46
|
|
|
+ and b2.id = b3.concept_id)
|
|
|
+ UNION
|
|
|
+ (SELECT b1.*,b2.id uniqueId,b2.lib_name uniqueName
|
|
|
+ FROM (SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,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_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 = #{detailType}
|
|
|
+ AND (t2.spell LIKE CONCAT('%',UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT('%',#{InputStr},'%'))
|
|
|
+ AND t4.relation_id = 18
|
|
|
+ GROUP BY t5.id) b1,
|
|
|
+ kl_concept b2,
|
|
|
+ kl_concept_detail b3
|
|
|
+ WHERE b2.is_deleted = 'N'
|
|
|
+ and b3.is_deleted = 'N'
|
|
|
+ and CONCAT(b1.parentName,'--',b1.selfName) = b2.lib_name
|
|
|
+ and b2.lib_type = 46
|
|
|
+ and b2.id = b3.concept_id)
|
|
|
</select>
|
|
|
|
|
|
<select id="getConceptConMap" resultType="com.diagbot.dto.ConceptBaseDTO" parameterType="com.diagbot.vo.ConceptFindVO">
|