|
@@ -190,7 +190,7 @@
|
|
|
SELECT a1.* 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_concept_common t3 ON t1.id = t2.concept_id
|
|
|
+ LEFT JOIN kl_concept_common t3 ON t1.id = t3.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
|
|
@@ -201,8 +201,12 @@
|
|
|
AND t4.is_deleted = 'N'
|
|
|
AND t5.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
+ AND t2.is_concept = 1
|
|
|
<if test="type != null">
|
|
|
- AND t1.lib_type = #{type}
|
|
|
+ AND t1.lib_type in
|
|
|
+ <foreach item="type" collection="type" open="(" separator="," close=")">
|
|
|
+ #{type}
|
|
|
+ </foreach>
|
|
|
</if>
|
|
|
<if test="sexType == 3">
|
|
|
and t3.sex_type in ('1','2','3')
|
|
@@ -225,7 +229,7 @@
|
|
|
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_concept_common t3 ON t1.id = t2.concept_id
|
|
|
+ LEFT JOIN kl_concept_common t3 ON t1.id = t3.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
|
|
@@ -236,8 +240,12 @@
|
|
|
AND t4.is_deleted = 'N'
|
|
|
AND t5.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
+ AND t2.is_concept = 1
|
|
|
<if test="type != null">
|
|
|
- AND t1.lib_type = #{type}
|
|
|
+ AND t1.lib_type in
|
|
|
+ <foreach item="type" collection="type" open="(" separator="," close=")">
|
|
|
+ #{type}
|
|
|
+ </foreach>
|
|
|
</if>
|
|
|
<if test="sexType == 3">
|
|
|
and t3.sex_type in ('1','2','3')
|
|
@@ -260,7 +268,7 @@
|
|
|
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_concept_common t3 ON t1.id = t2.concept_id
|
|
|
+ LEFT JOIN kl_concept_common t3 ON t1.id = t3.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
|
|
@@ -271,8 +279,12 @@
|
|
|
AND t4.is_deleted = 'N'
|
|
|
AND t5.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
+ AND t2.is_concept = 1
|
|
|
<if test="type != null">
|
|
|
- AND t1.lib_type = #{type}
|
|
|
+ AND t1.lib_type in
|
|
|
+ <foreach item="type" collection="type" open="(" separator="," close=")">
|
|
|
+ #{type}
|
|
|
+ </foreach>
|
|
|
</if>
|
|
|
<if test="sexType == 3">
|
|
|
and t3.sex_type in ('1','2','3')
|
|
@@ -295,7 +307,7 @@
|
|
|
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
|
|
|
LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
|
|
|
- LEFT JOIN kl_concept_common t3 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'
|
|
@@ -303,7 +315,10 @@
|
|
|
AND t3.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
<if test="type != null">
|
|
|
- AND t1.lib_type = #{type}
|
|
|
+ AND t1.lib_type in
|
|
|
+ <foreach item="type" collection="type" open="(" separator="," close=")">
|
|
|
+ #{type}
|
|
|
+ </foreach>
|
|
|
</if>
|
|
|
<if test="sexType == 3">
|
|
|
and t3.sex_type in ('1','2','3')
|
|
@@ -325,7 +340,7 @@
|
|
|
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
|
|
|
LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
|
|
|
- LEFT JOIN kl_concept_common t3 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'
|
|
@@ -333,7 +348,10 @@
|
|
|
AND t3.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
<if test="type != null">
|
|
|
- AND t1.lib_type = #{type}
|
|
|
+ AND t1.lib_type in
|
|
|
+ <foreach item="type" collection="type" open="(" separator="," close=")">
|
|
|
+ #{type}
|
|
|
+ </foreach>
|
|
|
</if>
|
|
|
<if test="sexType == 3">
|
|
|
and t3.sex_type in ('1','2','3')
|
|
@@ -355,7 +373,7 @@
|
|
|
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
|
|
|
LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
|
|
|
- LEFT JOIN kl_concept_common t3 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'
|
|
@@ -363,7 +381,10 @@
|
|
|
AND t3.is_deleted = 'N'
|
|
|
AND t6.is_deleted = 'N'
|
|
|
<if test="type != null">
|
|
|
- AND t1.lib_type = #{type}
|
|
|
+ AND t1.lib_type in
|
|
|
+ <foreach item="type" collection="type" open="(" separator="," close=")">
|
|
|
+ #{type}
|
|
|
+ </foreach>
|
|
|
</if>
|
|
|
<if test="sexType == 3">
|
|
|
and t3.sex_type in ('1','2','3')
|