在使用分页插件pagehelper的时候,出现了数据总数total总是和 Size 相同的情况。
public PageInfo<QuestionDto> PushQuestion(Integer pageNo, Integer pageSize){
PageHelper.startPage(pageNo,pageSize);
List<Question> questionList = questionMapper.findQuestion();
List<QuestionDto> questionDtoList = new ArrayList<>();
if(questionList!=null){
for (Question question : questionList) {
QuestionDto questionDto = new QuestionDto();
BeanUtils.copyProperties(question,questionDto);
questionDtoList.add(questionDto);
}
}
PageInfo<QuestionDto> pageInfo = new PageInfo<>(questionDtoList);
return pageInfo;
}
看了一下源码,他是这个样子