This commit is contained in:
禾几海
2020-05-27 13:28:48 +08:00
parent 21adedea84
commit 260ae53c8d
9 changed files with 151 additions and 74 deletions

View File

@@ -86,21 +86,29 @@
<select id="findAllByPagePath" resultMap="commentViewResultMap">
select *
from commentView
where pagePath = #{pagePath}
<if test="pagePath!= null ">
where pagePath = #{pagePath}
</if>
</select>
<select id="findAllByPagePathAndFromUser" resultMap="commentViewResultMap">
select *
from commentView
where pagePath = #{pagePath}
and fromAuthorId = #{userId}
where
<if test="pagePath!= null ">
pagePath = #{pagePath} and
</if>
fromAuthorId = #{userId}
</select>
<select id="findAllByPagePathAndPid" resultMap="commentViewResultMap">
select *
from commentView
where pagePath = #{pagePath}
and pid = #{pid}
where
<if test="pagePath!= null ">
pagePath = #{pagePath} and
</if>
pid = #{pid}
</select>
<select id="countByPagePath" resultType="java.lang.Long">
@@ -108,6 +116,7 @@
from commentView
where pagePath = #{pagePath}
</select>
<select id="getLastestComment" resultMap="commentViewResultMap">
select *
from commentView
@@ -117,7 +126,7 @@
<select id="count" resultType="long">
select count(*)
from article
from comment
where is_delete = false;
</select>

View File

@@ -155,7 +155,6 @@
select *
from articleView
where isDelete = false
order by articleId desc
</select>