selectWithAttrs 使用流分页
This commit is contained in:
parent
99bb41556d
commit
5176f58ac8
|
@ -255,10 +255,8 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
resultPage.setRecords(null);
|
||||
resultPage.setTotal(0);
|
||||
} else {
|
||||
ArrayList<ResourceDTO> recordLists = new ArrayList<>();
|
||||
for (int i = (pageNum - 1) * pageSize; i < j; i++) {
|
||||
recordLists.add(resourceDTOS.get(i));
|
||||
}
|
||||
List<ResourceDTO> recordLists = resourceDTOS.stream()
|
||||
.skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
|
||||
resultPage.setRecords(recordLists);
|
||||
resultPage.setTotal(resourceDTOS.size());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue