List<EpgPlayTableDateVo> collect = new ArrayList<>();
if (pageIndex > 0) {
// collect = voList.stream().skip((pageIndex - 1) * pageSize)
collect = voList2.stream().skip((pageIndex - 1) * pageSize)
.limit(pageSize).collect(Collectors.toList());
} else {
collect = voList2;
}
int totalSize = voList.size();
// 同一个字段进行比较排序
// 如果实现不了,就前端传一个字段,在mapper中进行if判断进行排序
collect.sort((EpgItvbOrderDetailVo v1, EpgItvbOrderDetailVo v2) -> v2.getTotalOrder().compareTo(v1.getTotalOrder()));
<if test=" orderType == 'desc' ">
order by pv desc
</if>
<if test=" orderType == 'asc' ">
order by pv ASC
</if>
stream流实现分页,排序
最新推荐文章于 2023-10-18 10:07:04 发布