wxz 2 years ago
parent
commit
f88ac1630d
  1. 21
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml

21
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml

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

Loading…
Cancel
Save