Service层修改 单元测试
This commit is contained in:
@@ -43,8 +43,8 @@
|
||||
|
||||
<delete id="deleteMultiById">
|
||||
delete from article_tag where at_id in
|
||||
<foreach item="item" collection="list" separator=",">
|
||||
(#{articleTag.id})
|
||||
<foreach item="item" collection="list" open="(" close=")" separator=",">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
@@ -73,4 +73,28 @@
|
||||
and tag_category.t_id = article_tag.t_id
|
||||
</select>
|
||||
|
||||
|
||||
<select id="findArticleByTag" resultMap="articleTagResultMap">
|
||||
select *
|
||||
from tag_category,
|
||||
article,
|
||||
article_tag
|
||||
where tag_category.t_id = #{tagId}
|
||||
and is_category = false
|
||||
and tag_category.t_id = article_tag.t_id
|
||||
and article_tag.a_id = article.a_id
|
||||
</select>
|
||||
|
||||
<select id="findArticleByTagAndOpen" resultMap="articleTagResultMap">
|
||||
select *
|
||||
from tag_category,
|
||||
article,
|
||||
article_tag
|
||||
where tag_category.t_id = #{tagId}
|
||||
and is_category = false
|
||||
and tag_category.t_id = article_tag.t_id
|
||||
and article.a_is_open = true
|
||||
and article_tag.a_id = article.a_id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -141,6 +141,15 @@
|
||||
order by articleId desc
|
||||
</select>
|
||||
|
||||
<select id="findAllByCategoryIdAndOpen" resultMap="articleViewResultMap">
|
||||
select *
|
||||
from articleView
|
||||
where categoryId = #{id}
|
||||
and isDelete = false
|
||||
and isOpen = true
|
||||
order by articleId desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="findAll" resultMap="articleViewResultMap">
|
||||
select *
|
||||
@@ -155,5 +164,22 @@
|
||||
from article;
|
||||
</select>
|
||||
|
||||
<select id="getPreArticle" resultMap="articleViewResultMap">
|
||||
select *
|
||||
from articleView
|
||||
where articleId = (select max(articleId)
|
||||
from articleView
|
||||
where articleId < #{id}
|
||||
)
|
||||
</select>
|
||||
<select id="getNextArticle" resultMap="articleViewResultMap">
|
||||
select *
|
||||
from articleView
|
||||
where articleId = (select min(articleId)
|
||||
from articleView
|
||||
where articleId > #{id}
|
||||
)
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user