1.确认导入的了maven依赖
2.在查询之前设置了page的相关参数
PageHelper.startPage(graduationMonthSearchDto.getPageNum(), graduationMonthSearchDto.getPageSize());
List<GraduationMonthEntity> list = graduationMonthMapper.getList(graduationMonthSearchDto);
PageInfo<GraduationMonthEntity> pageInfo = new PageInfo<>(list);
return pageInfo;
3.如果1,2两步都已经设置的话,请将maven依赖修改如下,既可
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.1.2</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.5</version>
</dependency>