|
@ -437,6 +437,7 @@ |
|
|
a.org_id AS "agencyId", |
|
|
a.org_id AS "agencyId", |
|
|
a.title AS "title", |
|
|
a.title AS "title", |
|
|
a.category AS "category", |
|
|
a.category AS "category", |
|
|
|
|
|
cd.CATEGORY_NAME, |
|
|
IFNULL(a.preview_content, "") AS "previewContent", |
|
|
IFNULL(a.preview_content, "") AS "previewContent", |
|
|
a.publish_range_desc AS "publishRangeDesc", |
|
|
a.publish_range_desc AS "publishRangeDesc", |
|
|
a.publisher_id AS "publisher", |
|
|
a.publisher_id AS "publisher", |
|
@ -453,16 +454,24 @@ |
|
|
ac.img_url AS "imgUrl" |
|
|
ac.img_url AS "imgUrl" |
|
|
FROM |
|
|
FROM |
|
|
article a |
|
|
article a |
|
|
|
|
|
inner join category_dict cd on (cd.DEL_FLAG = 0 and a.CATEGORY = cd.ID) |
|
|
LEFT JOIN article_cover ac ON a.id = ac.article_id AND ac.del_flag = '0' |
|
|
LEFT JOIN article_cover ac ON a.id = ac.article_id AND ac.del_flag = '0' |
|
|
WHERE |
|
|
WHERE |
|
|
a.del_flag = '0' |
|
|
a.del_flag = '0' |
|
|
<!-- 栏目 --> |
|
|
<!-- 栏目 --> |
|
|
<if test="subCategories != null and subCategories.size() > 0"> |
|
|
<if test="(subCategories != null and subCategories.size() > 0) or (category != null and category != '')"> |
|
|
and a.CATEGORY in ( |
|
|
and ( |
|
|
<foreach collection="subCategories" item="category" separator=","> |
|
|
<if test="subCategories != null and subCategories.size() > 0"> |
|
|
#{category} |
|
|
a.CATEGORY in ( |
|
|
</foreach> |
|
|
<foreach collection="subCategories" item="ctg" separator=","> |
|
|
) |
|
|
#{ctg} |
|
|
|
|
|
</foreach> |
|
|
|
|
|
) or |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="category != null and category != ''"> |
|
|
|
|
|
a.CATEGORY = #{category} |
|
|
|
|
|
</if> |
|
|
|
|
|
) |
|
|
</if> |
|
|
</if> |
|
|
<if test="articleId != null and articleId != '' "> |
|
|
<if test="articleId != null and articleId != '' "> |
|
|
AND a.id = #{articleId} |
|
|
AND a.id = #{articleId} |
|
|