一、导入依赖
com.github.pagehelper
pagehelper-spring-boot-starter
com.github.pagehelper
pagehelper
二、代码使用
@Override
public List showDoctor(int page, int num) {
// 设置分页参数
PageHelper.startPage(page,num);
DoctorExample doctorExample = new DoctorExample();
doctorExample.setOrderByClause("doctorid");
List doctors = doctorMapper.selectByExample(doctorExample);
// 使用分页插件
PageInfo doctorPageInfo = new PageInfo<>(doctors);
return doctorPageInfo.getList();
}



