springboot 中pagehelper出现分页问题

一 问题描述

问题描述: 总共8条,每页3条,总共有3页,现在查询第5页,为何一直显示第3页最后一页的数据呢?

springboot 中pagehelper出现分页问题_第1张图片

 二  原因以及解决办法

2.1 原因

pagehelper的reasonable 默认为false,遇到查询页数大于总页数时,查询为空;当reasonable设置为true时,遇到查询页数大于总页数时,查询最后一页数据;

2.2 重新设置

1.进行设置

springboot 中pagehelper出现分页问题_第2张图片

 2.再次访问

springboot 中pagehelper出现分页问题_第3张图片

 https://huaweicloud.csdn.net/63355eefd3efff3090b54769.html?spm=1001.2101.3001.6650.3&utm_medium=distribute.pc_relevant.none-task-blog-2~default~CTRLIST~activity-3-120875992-blog-128311759.235^v28^pc_relevant_t0_download&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2~default~CTRLIST~activity-3-120875992-blog-128311759.235^v28^pc_relevant_t0_download&utm_relevant_index=6

你可能感兴趣的:(springboot,spring,boot,后端,java)