1.导入依赖
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.13</version>
</dependency>
2.使用
@Override
public ApiRes queryAll(int pageNum,int pageSize,String code,String name,String mobile) {
PageHelper.startPage(pageNum,pageSize);
List<Manager> managers = managerMapper.queryAll(code, name, mobile);
PageInfo<Manager> info = new PageInfo<>(managers);
return new ApiRes<PageInfo<Manager>>(info);
}