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

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

@ -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,15 +454,23 @@
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) or (category != null and category != '')">
and (
<if test="subCategories != null and subCategories.size() > 0"> <if test="subCategories != null and subCategories.size() > 0">
and a.CATEGORY in ( a.CATEGORY in (
<foreach collection="subCategories" item="category" separator=","> <foreach collection="subCategories" item="ctg" separator=",">
#{category} #{ctg}
</foreach> </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 != '' ">

Loading…
Cancel
Save