|
@@ -22,30 +22,34 @@
|
|
|
|
|
|
<select id="getAllKnowledge" resultType="com.diagbot.dto.LibraryDetailDTO">
|
|
|
SELECT
|
|
|
- a.id,
|
|
|
- a.is_deleted,
|
|
|
- a.gmt_create,
|
|
|
- a.gmt_modified,
|
|
|
- a.creator,
|
|
|
- a.modifier,
|
|
|
+ id,
|
|
|
+ is_deleted,
|
|
|
+ gmt_create,
|
|
|
+ gmt_modified,
|
|
|
+ creator,
|
|
|
+ modifier,
|
|
|
b.name,
|
|
|
b.type,
|
|
|
a.concept_id,
|
|
|
- a.source,
|
|
|
- a.title,
|
|
|
- a.content,
|
|
|
- a.text,
|
|
|
- a.order_no,
|
|
|
- a.position,
|
|
|
- a.is_reason
|
|
|
- FROM library_detail a, library_info b
|
|
|
- WHERE a.is_deleted = "N" AND a.concept_id = b.concept_id AND b.is_concept=1
|
|
|
- <if test = "term != ''">
|
|
|
- AND b.name like '%#{term}%'
|
|
|
- </if>
|
|
|
- <if test = "type != ''">
|
|
|
- AND b.type = #{type}
|
|
|
- </if>
|
|
|
+ source,
|
|
|
+ title,
|
|
|
+ content,
|
|
|
+ text,
|
|
|
+ order_no,
|
|
|
+ position,
|
|
|
+ is_reason
|
|
|
+ FROM library_detail a,
|
|
|
+ (SELECT concept_id, name, type
|
|
|
+ FROM library_info
|
|
|
+ WHERE is_concept = 1
|
|
|
+ <if test = "term != ''">
|
|
|
+ AND name LIKE concat('%',#{term},'%')
|
|
|
+ </if>
|
|
|
+ <if test = "type != ''">
|
|
|
+ AND type = #{type}
|
|
|
+ </if>
|
|
|
+ ) b
|
|
|
+ WHERE a.is_deleted = "N" AND a.concept_id = b.concept_id
|
|
|
ORDER BY a.concept_id
|
|
|
</select>
|
|
|
|