import com.github.pagehelper.PageInfo;
import com.test.entity.*;
import com.test.mapper.testMapper;
....
// ------------------------- 主要内容
// 封装分页查询结果到 PageInfo 对象中以获取相关分页信息,自动分页
List<TestEntity> testList = testMapper.getTestList();
PageInfo pageInfo = new PageInfo(testList );
System.err.println(pageInfo.getTotal()) // 总数
System.err.println(pageInfo.getList()) // 分页后的数据列表
// ------------------------- 主要内容
若依框架 访问MySQL Java 代码分页功能(自动分页) pagehelper的PageInfo
于 2023-08-19 17:41:16 首次发布