Explorar o código

云平台静态知识翻页查询SQL优化

gaodm %!s(int64=5) %!d(string=hai) anos
pai
achega
3b26ed736f

+ 5 - 5
knowledgeman-service/src/main/resources/mapper/ConceptDetailMapper.xml

@@ -20,17 +20,17 @@
     </resultMap>
 
    	<select id="getConceptDetailList" resultType="com.diagbot.dto.GetConceptDetailListDTO">
-   		SELECT b.id concept_id, b.lib_name,b.lib_type as typeId, group_concat(title) title, a.is_deleted, a.modifier, a.gmt_modified
-		FROM kl_concept_detail a ,kl_concept b
-		WHERE   b.is_deleted='N' and a.concept_id=b.id
+        SELECT a.concept_id concept_id, b.lib_name,b.lib_type as typeId, group_concat(title) title, a.is_deleted, a.modifier, a.gmt_modified
+        FROM kl_concept_detail a ,kl_concept b
+        WHERE   b.is_deleted='N' and a.concept_id=b.id
 		<if test="conceptName!=null and conceptName!=''">
 			and b.`lib_name` like concat('%',#{conceptName},'%')
 		</if>
 		<if test="status!=null and status!=''">
 			and a.is_deleted = #{status}
 		</if>
-		group by b.id, b.lib_name
-		ORDER BY a.is_deleted ASC, a.gmt_modified DESC
+        group by a.concept_id
+        ORDER BY a.is_deleted ASC, a.gmt_modified DESC
    	</select>