Service层修改 单元测试

This commit is contained in:
禾几海
2020-05-25 21:43:53 +08:00
parent 9e6868b638
commit 67a1b1faf9
12 changed files with 317 additions and 253 deletions

View File

@@ -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>

View File

@@ -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 &lt; #{id}
)
</select>
<select id="getNextArticle" resultMap="articleViewResultMap">
select *
from articleView
where articleId = (select min(articleId)
from articleView
where articleId &gt; #{id}
)
</select>
</mapper>