当前位置:网站首页>Manually page the list (parameter list, current page, page size)
Manually page the list (parameter list, current page, page size)
2022-07-04 06:05:00 【Hello song Xianshen】
/** * For the result list The method of paging * @param list * @param pageNum * @param pageSize * @return */ public static IPage listToPage(List list, int pageNum, int pageSize){ List pageList = new ArrayList<>(); int curIdx = pageNum > 1 ? (pageNum - 1) * pageSize : 0; for (int i = 0; i < pageSize && curIdx + i < list.size(); i++) { pageList.add(list.get(curIdx + i)); } IPage page = new Page<>(pageNum, pageSize); page.setRecords(pageList); page.setTotal(list.size()); return page; }
@Override public IPage<AllGamePlatformByMonth> getList(Page startPage, AllGamePlatformByMonth allGamePlatformByMonth) { List<AllGamePlatformByMonth> resultList = allGamePlatformByMonthService.getAllGamePlatformByMonthList(allGamePlatformByMonth); IPage <AllGamePlatformByMonth> iPage = listToPage(resultList, (int) startPage.getCurrent(), (int) startPage.getSize()); return iPage; }
边栏推荐
- Tf/pytorch/cafe-cv/nlp/ audio - practical demonstration of full ecosystem CPU deployment - Intel openvino tool suite course summary (Part 2)
- Component、Container容器常用API详解:Frame、Panel、ScrollPane
- AWT介绍
- el-select如何实现懒加载(带搜索功能)
- [Chongqing Guangdong education] electronic circuit homework question bank of RTVU secondary school
- Layoutmanager layout manager: flowlayout, borderlayout, GridLayout, gridbaglayout, CardLayout, BoxLayout
- transformer坑了多少算力
- left_and_right_net正常版本
- left_ and_ right_ Net interpretable design
- Detectron:训练自己的数据集——将自己的数据格式转换成COCO格式
猜你喜欢
C language - Blue Bridge Cup - Snake filling
JS扁平化数形结构的数组
Component、Container容器常用API详解:Frame、Panel、ScrollPane
198. House raiding
4G wireless all network solar hydrological equipment power monitoring system bms110
报错cvc-complex-type.2.4.a: 发现了以元素 ‘base-extension‘ 开头的无效内容。应以 ‘{layoutlib}‘ 之一开头。
QT QTableWidget 表格列置顶需求的思路和代码
[excel] PivotChart
检漏继电器JY82-2P
input显示当前选择的图片
随机推荐
JS how to convert seconds into hours, minutes and seconds display
ABAP:OOALV实现增删改查功能
el-select如何实现懒加载(带搜索功能)
left_ and_ right_ Net normal version
Detectron: train your own data set -- convert your own data format to coco format
Take you to quickly learn how to use qsort and simulate qsort
如何获取el-tree中所有节点的父节点
我的NVIDIA开发者之旅——优化显卡性能
1480. Dynamic sum of one-dimensional array
Design and implementation of redis 7.0 multi part AOF
Use of hutool Pinyin tool
buuctf-pwn write-ups (8)
实用的小工具指令
Learning multi-level structural information for small organ segmentation
fastjson
Configure cross compilation tool chain and environment variables
对List进行排序工具类,可以对字符串排序
Basic concept of bus
Tutle clock improved version
Wechat applet +php realizes authorized login