update BaseMapper list rename to select
This commit is contained in:
@ -19,7 +19,7 @@ public interface ArticleMapper extends BaseMapper<Article, Long> {
|
|||||||
long countByPage(Page page);
|
long countByPage(Page page);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
List<Article> listByPage(Page page);
|
List<Article> selectByPage(Page page);
|
||||||
|
|
||||||
long countByKeyword(String keyword);
|
long countByKeyword(String keyword);
|
||||||
|
|
||||||
|
|||||||
@ -58,7 +58,7 @@ public class ArticleServiceImplement extends AbstractEntityService<Article, Long
|
|||||||
@Override
|
@Override
|
||||||
public PageResult<Article> page(Page page) {
|
public PageResult<Article> page(Page page) {
|
||||||
PageResult<Article> result = new PageResult<>();
|
PageResult<Article> result = new PageResult<>();
|
||||||
result.setList(mapper.listByPage(page));
|
result.setList(mapper.selectByPage(page));
|
||||||
result.setTotal(mapper.countByPage(page));
|
result.setTotal(mapper.countByPage(page));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ public interface CommentMapper extends BaseMapper<Comment, Long> {
|
|||||||
long countByPage(Page page);
|
long countByPage(Page page);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
List<Comment> listByPage(Page page);
|
List<Comment> selectByPage(Page page);
|
||||||
|
|
||||||
@Select("SELECT * FROM comment WHERE id = #{id}" + NOT_DELETE)
|
@Select("SELECT * FROM comment WHERE id = #{id}" + NOT_DELETE)
|
||||||
Comment select(Long id);
|
Comment select(Long id);
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
<select id="countByPage" resultType="long">
|
<select id="countByPage" resultType="long">
|
||||||
SELECT COUNT(1) <include refid="normalCondition" />
|
SELECT COUNT(1) <include refid="normalCondition" />
|
||||||
</select>
|
</select>
|
||||||
<select id="listByPage" resultType="com.imyeyu.api.modules.blog.entity.Article">
|
<select id="selectByPage" resultType="com.imyeyu.api.modules.blog.entity.Article">
|
||||||
SELECT
|
SELECT
|
||||||
<include refid="listColumn" />
|
<include refid="listColumn" />
|
||||||
<include refid="normalCondition" />
|
<include refid="normalCondition" />
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<mapper namespace="com.imyeyu.api.modules.common.mapper.CommentMapper">
|
<mapper namespace="com.imyeyu.api.modules.common.mapper.CommentMapper">
|
||||||
<sql id="table">comment</sql>
|
<sql id="table">comment</sql>
|
||||||
<!-- 主评论 -->
|
<!-- 主评论 -->
|
||||||
<select id="list" resultMap="listResult">
|
<select id="selectByPage" resultMap="selectResult">
|
||||||
SELECT
|
SELECT
|
||||||
-- 主评论
|
-- 主评论
|
||||||
comment.id,
|
comment.id,
|
||||||
@ -77,7 +77,7 @@
|
|||||||
ON
|
ON
|
||||||
reply_count.id = comment.id
|
reply_count.id = comment.id
|
||||||
</select>
|
</select>
|
||||||
<resultMap id="listResult" type="com.imyeyu.api.modules.common.vo.comment.CommentView">
|
<resultMap id="selectResult" type="com.imyeyu.api.modules.common.vo.comment.CommentView">
|
||||||
<id property="id" column="id" />
|
<id property="id" column="id" />
|
||||||
<result property="userId" column="user_id" />
|
<result property="userId" column="user_id" />
|
||||||
<result property="nick" column="nick" />
|
<result property="nick" column="nick" />
|
||||||
@ -96,7 +96,7 @@
|
|||||||
<result property="createdAt" column="reply_created_at" />
|
<result property="createdAt" column="reply_created_at" />
|
||||||
</collection>
|
</collection>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<select id="countAll" resultType="long">
|
<select id="countByPage" resultType="long">
|
||||||
SELECT
|
SELECT
|
||||||
SUM(result.total_comment + result.total_reply)
|
SUM(result.total_comment + result.total_reply)
|
||||||
FROM (
|
FROM (
|
||||||
|
|||||||
Reference in New Issue
Block a user