pageHelper没有完成分页(sql里没有被拼接上limit)
下面是service层
@Override
public PageResult pageQuery(ArticleConditionDto articleConditionDto) {
PageHelper.startPage(articleConditionDto.getCurrentPage(),articleConditionDto.getPageSize());
List<ArticleListVo> articleListVoList=articleMapper.pageQuery(articleConditionDto);
articleListVoList.forEach(articleListVo -> {
Long id = articleListVo.getId();
Category category=categoryMapper.getCategoryById(id);
articleListVo.setCategory(category);
//根据文章id拿到所有标签id
Long[] ids=articleTagMapper.selectByIdGetTagId(id);
//根据标签id拿到所有标签名称
List<Tags> tags=tagMapper.selectListById(ids);
articleListVo.setTags(tags);
});
log.info("分页查询结果:{}",articleListVoList);
return new PageResult(articleListVoList.size(),articleListVoList);
}
下面是mapper层
<select id="pageQuery" resultType="uno.stan.myblogBack.vo.ArticleListVo">
SELECT DISTINCT a.*
FROM article a
JOIN article_tag at ON a.id = at.article_id
<where>
<if test="categoryId != null">
AND categoryId = #{categoryId}
</if>
<if test="description != null and !description.isEmpty()">
AND description LIKE CONCAT('%', #{description}, '%')
</if>
<if test="title != null and !title.isEmpty()">
AND title LIKE CONCAT('%', #{title}, '%')
</if>
<if test="startTime != null and endTime != null">
AND createdTime BETWEEN #{startTime} AND #{endTime}
</if>
<if test="tagIds != null and tagIds.size() > 0">
AND at.tag_id IN
<foreach item="tagId" index="index" collection="tagIds" open="(" separator="," close=")">
#{tagId}
</foreach>
</if>
</where>
order by a.created_time desc
</select>
最后sql语句上面没有拼接上limit

请问是为什么呢 下面是依赖版本


