探险了一处错误如果你使用SpringBoot写的,那么你需要引入以下依赖
<!-- 分页插件--> <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-spring-boot-starter</artifactId> <version>1.2.5</version> </dependency>
只是单纯的goole插件不能使用在SpringBoot上面
还有一个
PageHelper.startPage(page,size);
List<ClazzAndStu> studentList = studentMapper.selectByPrimaryKeyAndClass(student.getId());
使用 PageHelper.startPage(page,size);后面一行一定是要跟sql查询 不能进行任何封装,一旦封装PageHelper中页面以及记录都不准确了