|
|
|
|
@ -8,6 +8,7 @@
|
|
|
|
|
<result property="articleContent" column="article_content"/>
|
|
|
|
|
<result property="isTop" column="is_top"/>
|
|
|
|
|
<result property="isFeatured" column="is_featured"/>
|
|
|
|
|
<result property="status" column="status"/>
|
|
|
|
|
<result property="createTime" column="create_time"/>
|
|
|
|
|
<result property="updateTime" column="update_time"/>
|
|
|
|
|
<result property="categoryName" column="category_name"/>
|
|
|
|
|
@ -65,6 +66,7 @@
|
|
|
|
|
SUBSTR(article_content, 1, 500) AS article_content,
|
|
|
|
|
is_top,
|
|
|
|
|
is_featured,
|
|
|
|
|
status,
|
|
|
|
|
a.create_time AS create_time,
|
|
|
|
|
a.update_time AS update_time,
|
|
|
|
|
u.nickname AS author_nickname,
|
|
|
|
|
@ -91,7 +93,7 @@
|
|
|
|
|
LEFT JOIN t_category c ON a.category_id = c.id
|
|
|
|
|
LEFT JOIN t_user_info u ON a.user_id = u.id
|
|
|
|
|
where a.is_delete = 0
|
|
|
|
|
and a.status = 1
|
|
|
|
|
and a.status in (1, 2)
|
|
|
|
|
order by is_top desc, is_featured desc
|
|
|
|
|
</select>
|
|
|
|
|
<select id="listArticles" resultMap="ArticleCardDTOResultMap">
|
|
|
|
|
@ -101,6 +103,7 @@
|
|
|
|
|
SUBSTR(article_content, 1, 500) AS article_content,
|
|
|
|
|
is_top,
|
|
|
|
|
is_featured,
|
|
|
|
|
status,
|
|
|
|
|
a.create_time AS create_time,
|
|
|
|
|
a.update_time AS update_time,
|
|
|
|
|
u.nickname AS author_nickname,
|
|
|
|
|
@ -122,7 +125,7 @@
|
|
|
|
|
update_time
|
|
|
|
|
FROM t_article
|
|
|
|
|
where is_delete = 0
|
|
|
|
|
and status = 1
|
|
|
|
|
and status in (1, 2)
|
|
|
|
|
order by id desc
|
|
|
|
|
LIMIT #{current} , #{size}) a
|
|
|
|
|
LEFT JOIN t_article_tag at
|
|
|
|
|
@ -138,6 +141,7 @@
|
|
|
|
|
SUBSTR(article_content, 1, 500) AS article_content,
|
|
|
|
|
is_top,
|
|
|
|
|
is_featured,
|
|
|
|
|
status,
|
|
|
|
|
a.create_time AS create_time,
|
|
|
|
|
a.update_time AS update_time,
|
|
|
|
|
u.nickname AS author_nickname,
|
|
|
|
|
@ -160,7 +164,7 @@
|
|
|
|
|
FROM t_article
|
|
|
|
|
WHERE category_id = #{categoryId}
|
|
|
|
|
and is_delete = 0
|
|
|
|
|
and status = 1
|
|
|
|
|
and status in (1, 2)
|
|
|
|
|
order by id desc
|
|
|
|
|
LIMIT #{current} , #{size}) a
|
|
|
|
|
LEFT JOIN t_article_tag at
|
|
|
|
|
@ -202,7 +206,7 @@
|
|
|
|
|
FROM t_article
|
|
|
|
|
WHERE id = #{articleId}
|
|
|
|
|
and is_delete = 0
|
|
|
|
|
and status = 1) a
|
|
|
|
|
and status in (1, 2)) a
|
|
|
|
|
LEFT JOIN t_article_tag at
|
|
|
|
|
ON a.id = at.article_id
|
|
|
|
|
LEFT JOIN t_tag t ON t.id = at.tag_id
|
|
|
|
|
@ -216,6 +220,7 @@
|
|
|
|
|
SUBSTR(article_content, 1, 500) AS article_content,
|
|
|
|
|
is_top,
|
|
|
|
|
is_featured,
|
|
|
|
|
status,
|
|
|
|
|
a.create_time AS create_time,
|
|
|
|
|
a.update_time AS update_time,
|
|
|
|
|
u.nickname AS author_nickname,
|
|
|
|
|
@ -238,7 +243,7 @@
|
|
|
|
|
FROM t_article
|
|
|
|
|
WHERE id < #{articleId}
|
|
|
|
|
and is_delete = 0
|
|
|
|
|
and status = 1
|
|
|
|
|
and status in (1, 2)
|
|
|
|
|
order by id desc
|
|
|
|
|
limit 0, 1) a
|
|
|
|
|
LEFT JOIN t_article_tag at
|
|
|
|
|
@ -254,6 +259,7 @@
|
|
|
|
|
SUBSTR(article_content, 1, 500) AS article_content,
|
|
|
|
|
is_top,
|
|
|
|
|
is_featured,
|
|
|
|
|
status,
|
|
|
|
|
a.create_time AS create_time,
|
|
|
|
|
a.update_time AS update_time,
|
|
|
|
|
u.nickname AS author_nickname,
|
|
|
|
|
@ -276,7 +282,7 @@
|
|
|
|
|
FROM t_article
|
|
|
|
|
WHERE id > #{articleId}
|
|
|
|
|
and is_delete = 0
|
|
|
|
|
and status = 1
|
|
|
|
|
and status in (1, 2)
|
|
|
|
|
order by id
|
|
|
|
|
limit 0,1) a
|
|
|
|
|
LEFT JOIN t_article_tag at
|
|
|
|
|
@ -292,6 +298,7 @@
|
|
|
|
|
SUBSTR(article_content, 1, 500) AS article_content,
|
|
|
|
|
is_top,
|
|
|
|
|
is_featured,
|
|
|
|
|
status,
|
|
|
|
|
a.create_time AS create_time,
|
|
|
|
|
a.update_time AS update_time,
|
|
|
|
|
u.nickname AS author_nickname,
|
|
|
|
|
@ -313,7 +320,7 @@
|
|
|
|
|
update_time
|
|
|
|
|
FROM t_article
|
|
|
|
|
WHERE is_delete = 0
|
|
|
|
|
and status = 1
|
|
|
|
|
and status in (1, 2)
|
|
|
|
|
order by id
|
|
|
|
|
limit 0,1) a
|
|
|
|
|
LEFT JOIN t_article_tag at
|
|
|
|
|
@ -329,6 +336,7 @@
|
|
|
|
|
SUBSTR(article_content, 1, 500) AS article_content,
|
|
|
|
|
is_top,
|
|
|
|
|
is_featured,
|
|
|
|
|
status,
|
|
|
|
|
a.create_time AS create_time,
|
|
|
|
|
a.update_time AS update_time,
|
|
|
|
|
u.nickname AS author_nickname,
|
|
|
|
|
@ -350,7 +358,7 @@
|
|
|
|
|
update_time
|
|
|
|
|
FROM t_article
|
|
|
|
|
WHERE is_delete = 0
|
|
|
|
|
and status = 1
|
|
|
|
|
and status in (1, 2)
|
|
|
|
|
order by id desc
|
|
|
|
|
limit 0,1) a
|
|
|
|
|
LEFT JOIN t_article_tag at
|
|
|
|
|
@ -367,6 +375,7 @@
|
|
|
|
|
SUBSTR(article_content, 1, 500) AS article_content,
|
|
|
|
|
is_top,
|
|
|
|
|
is_featured,
|
|
|
|
|
status,
|
|
|
|
|
a.create_time AS create_time,
|
|
|
|
|
a.update_time AS update_time,
|
|
|
|
|
u.nickname AS author_nickname,
|
|
|
|
|
@ -380,7 +389,9 @@
|
|
|
|
|
LEFT JOIN t_tag t ON t.id = at.tag_id
|
|
|
|
|
LEFT JOIN t_category c ON a.category_id = c.id
|
|
|
|
|
LEFT JOIN t_user_info u ON a.user_id = u.id
|
|
|
|
|
WHERE at.tag_id = #{tagId} and a.is_delete = 0 and status = 1
|
|
|
|
|
WHERE at.tag_id = #{tagId}
|
|
|
|
|
and a.is_delete = 0
|
|
|
|
|
and status in (1, 2)
|
|
|
|
|
LIMIT #{current} , #{size}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="listArchives" resultType="com.aurora.dto.ArticleCardDTO">
|
|
|
|
|
|