|
@@ -77,74 +77,6 @@
|
|
|
ORDER BY b.order_no ASC,a.gmt_modified DESC
|
|
|
</select>
|
|
|
|
|
|
- <select id="relationContactList" resultType="com.diagbot.dto.RelationContactListDTO">
|
|
|
- SELECT
|
|
|
- *
|
|
|
- FROM
|
|
|
- (SELECT
|
|
|
- t2.id AS conceptId,
|
|
|
- t2.lib_name AS libName,
|
|
|
- t4.name AS libType,
|
|
|
- CONCAT(t2.lib_name,'(',t4.name,')') AS libNameType,
|
|
|
- GROUP_CONCAT(t3.lib_name ORDER BY t5.order_no ASC,t1.gmt_modified DESC) AS otherNames,
|
|
|
- t1.modifier AS operName,
|
|
|
- MAX(t1.gmt_modified) AS operTime,
|
|
|
- t1.is_deleted AS isDeleted
|
|
|
- FROM
|
|
|
- (SELECT
|
|
|
- a.*
|
|
|
- FROM
|
|
|
- (SELECT * FROM kl_relation WHERE relation_id=17) a
|
|
|
- LEFT JOIN (SELECT start_id FROM kl_relation WHERE relation_id=17) b
|
|
|
- ON a.end_id=b.start_id
|
|
|
- LEFT JOIN (SELECT end_id FROM kl_relation WHERE relation_id=17) c
|
|
|
- ON a.start_id=c.end_id
|
|
|
- WHERE b.start_id IS NULL AND c.end_id IS NULL) t1
|
|
|
- JOIN kl_concept t2 ON t1.start_id=t2.id
|
|
|
- JOIN kl_concept t3 ON t1.end_id=t3.id
|
|
|
- JOIN kl_lexicon t4 ON t2.lib_type=t4.id
|
|
|
- LEFT JOIN kl_relation_order t5 ON t1.id=t5.t_relation_id
|
|
|
- where t2.is_deleted='N' AND t3.is_deleted='N' AND t4.is_deleted='N'
|
|
|
- GROUP BY t2.id) tab
|
|
|
- where 1=1
|
|
|
- <if test="name!=null and name!=''">
|
|
|
- and libNameType like concat('%',#{name},'%')
|
|
|
- </if>
|
|
|
- ORDER BY isDeleted ASC,operTime DESC
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="multContactList" resultType="com.diagbot.dto.MultContactListDTO">
|
|
|
- SELECT
|
|
|
- a.start_id AS conceptId,
|
|
|
- a.modifier AS operName,
|
|
|
- a.gmt_modified AS operTime,
|
|
|
- a.is_deleted AS isDeleted,
|
|
|
- GROUP_CONCAT(DISTINCT a.end_id ORDER BY d.order_no ASC) AS otherIds,
|
|
|
- SUM(CASE WHEN b.start_id IS NULL THEN 0 ELSE 1 END) AS notnullcou
|
|
|
- FROM
|
|
|
- (SELECT * FROM kl_relation WHERE relation_id=17
|
|
|
- <choose>
|
|
|
- <when test="rootNodeConceptIds==null"></when>
|
|
|
- <when test="rootNodeConceptIds.size==0">
|
|
|
- AND start_id=-99999999
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- AND start_id IN
|
|
|
- <foreach collection="rootNodeConceptIds" open="(" close=")" separator="," item="rootNodeConceptId">
|
|
|
- #{rootNodeConceptId}
|
|
|
- </foreach>
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- ) a
|
|
|
- LEFT JOIN (SELECT start_id FROM kl_relation WHERE relation_id=17) b ON a.end_id=b.start_id
|
|
|
- LEFT JOIN (SELECT end_id FROM kl_relation WHERE relation_id=17) c ON a.start_id=c.end_id
|
|
|
- LEFT JOIN kl_relation_order d ON a.id=d.t_relation_id
|
|
|
- WHERE c.end_id IS NULL
|
|
|
- GROUP BY a.start_id
|
|
|
- HAVING notnullcou>0
|
|
|
- ORDER BY operTime DESC
|
|
|
- </select>
|
|
|
-
|
|
|
<select id="lisSonContactList" resultType="com.diagbot.dto.LisSonContactListDTO">
|
|
|
SELECT
|
|
|
*
|