Browse Source

关联维护修改

rgb 6 years ago
parent
commit
1fc7c12760
1 changed files with 7 additions and 7 deletions
  1. 7 7
      knowledgeman-service/src/main/resources/mapper/RelationMapper.xml

+ 7 - 7
knowledgeman-service/src/main/resources/mapper/RelationMapper.xml

@@ -85,7 +85,7 @@
 		t2.lib_name AS libName,
 		t4.name AS libType,
 		CONCAT(t2.lib_name,'(',t4.name,')') AS libNameType,
-		GROUP_CONCAT(t3.lib_name ORDER BY t1.gmt_modified DESC) AS otherNames,
+		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
@@ -94,15 +94,15 @@
 		a.*
 		FROM
 		(SELECT * FROM kl_relation WHERE relation_id=17) a
-		LEFT JOIN kl_relation_order b ON a.id=b.t_relation_id
-		<!-- LEFT JOIN (SELECT * FROM kl_relation WHERE relation_id=17) c
-		ON a.end_id=c.start_id
-		LEFT JOIN (SELECT * FROM kl_relation WHERE relation_id=17) d
-		ON a.start_id=d.end_id -->
-		WHERE b.id IS NULL <!-- AND c.id IS NULL AND d.id IS NULL -->) t1
+		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