|
|
|
@ -508,6 +508,80 @@ |
|
|
|
ORDER BY a.publish_date DESC, a.updated_time DESC |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectAllArticle2" resultType="com.epmet.dto.result.PublishedListResultDTO"> |
|
|
|
SELECT |
|
|
|
a.id AS "articleId", |
|
|
|
a.org_id AS "agencyId", |
|
|
|
a.title AS "title", |
|
|
|
IFNULL(a.preview_content, "") AS "previewContent", |
|
|
|
a.publish_range_desc AS "publishRangeDesc", |
|
|
|
a.publisher_id AS "publisher", |
|
|
|
a.publisher_name AS "publisherName", |
|
|
|
a.publisher_type AS "publisherType", |
|
|
|
a.publish_date AS "publishDate", |
|
|
|
IFNULL(a.tags, "") AS "tags", |
|
|
|
a.status_flag AS "statusFlag", |
|
|
|
IF (a.status_flag = 'published', '已发布', '已下线') "statusFlagName", |
|
|
|
a.rich_text_flag AS "richTextFlag", |
|
|
|
a.created_by AS "createdBy", |
|
|
|
a.is_top AS "isTop", |
|
|
|
IF (a.is_top = '0', '否', '是') "isTopName", |
|
|
|
ac.img_url AS "imgUrl" |
|
|
|
FROM |
|
|
|
article a |
|
|
|
LEFT JOIN article_cover ac ON a.id = ac.article_id AND ac.del_flag = '0' |
|
|
|
LEFT JOIN article_tags art ON a.id = art.ARTICLE_ID AND art.del_flag = '0' |
|
|
|
WHERE |
|
|
|
a.del_flag = '0' |
|
|
|
<if test="articleId != null and articleId != '' "> |
|
|
|
AND a.id = #{articleId} |
|
|
|
</if> |
|
|
|
<if test="customerId != null and customerId != '' "> |
|
|
|
AND a.customer_id = #{customerId} |
|
|
|
</if> |
|
|
|
<if test="agencyId != null and agencyId != '' "> |
|
|
|
AND a.org_id_path like concat('%',#{agencyId},'%') |
|
|
|
</if> |
|
|
|
<if test="title != null and title.trim() != ''"> |
|
|
|
AND a.title like concat('%', #{title}, '%') |
|
|
|
</if> |
|
|
|
<if test="statusFlag != null and statusFlag.trim() != ''"> |
|
|
|
AND a.status_flag = #{statusFlag} |
|
|
|
</if> |
|
|
|
<if test="startDate != null and startDate.trim() != ''"> |
|
|
|
AND a.publish_date >= #{startDate} |
|
|
|
</if> |
|
|
|
<if test="endDate != null and endDate.trim() != ''"> |
|
|
|
<![CDATA[AND a.publish_date <= #{endDate}]]> |
|
|
|
</if> |
|
|
|
<if test="publishRangeType != null and publishRangeType.trim() != '' and publishRangeId != null and publishRangeId.trim() != ''"> |
|
|
|
<choose> |
|
|
|
<when test='publishRangeType == "agency"'> |
|
|
|
AND EXISTS( |
|
|
|
SELECT 1 FROM article_publish_range |
|
|
|
WHERE del_flag = '0' |
|
|
|
AND article_id = a.id |
|
|
|
AND agency_id = #{publishRangeId} |
|
|
|
and PUBLISH_STATUS='published' |
|
|
|
) |
|
|
|
</when> |
|
|
|
<otherwise> |
|
|
|
AND EXISTS( |
|
|
|
SELECT 1 FROM article_publish_range |
|
|
|
WHERE del_flag = '0' |
|
|
|
AND article_id = a.id |
|
|
|
AND grid_id = #{publishRangeId} |
|
|
|
and PUBLISH_STATUS='published' |
|
|
|
) |
|
|
|
</otherwise> |
|
|
|
</choose> |
|
|
|
</if> |
|
|
|
<if test="tagCategory !=null and tagCategory !=''"> |
|
|
|
AND art.TAG_ID IN(SELECT id FROM tag_customer WHERE TAG_CATEGORY = #{tagCategory}) |
|
|
|
</if> |
|
|
|
ORDER BY a.publish_date DESC, a.updated_time DESC |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 根据标签名,查询文章列表 --> |
|
|
|
<select id="pageArticleListByTagName" parameterType="map" resultType="com.epmet.dto.result.ArticleLatestResultDTO"> |
|
|
|
SELECT |
|
|
|
|