标签:new turn dex tin info tar gen 多少 sub
PageInfo getPageInfo(int pageNum, int pageSize, List<Map> list) {
Page page = new Page(pageNum, pageSize);
int total = list.size();
if (total > pageSize) {
int toIndex = pageNum * pageSize;
int startIndex = (pageNum - 1) * pageSize;
if (toIndex > total) {
toIndex = total;//结尾index
}
page.addAll(list.subList(startIndex, toIndex));
}
page.setPages((total - 1) / pageSize + 1);//总共有多少页
page.setTotal(total);
PageInfo pageInfo = new PageInfo(page);
return pageInfo;
}
标签:new turn dex tin info tar gen 多少 sub
原文地址:https://www.cnblogs.com/aliceQin/p/13156109.html