肖海南学生管理模糊分页修改

master
总裁 5 months ago
parent 1daff442b4
commit 53f7dc9bda
  1. 10
      src/main/java/com/teaching/backend/service/impl/umsAdmin/UmsStudentManageServiceImpl.java

@ -69,14 +69,20 @@ public class UmsStudentManageServiceImpl extends ServiceImpl<UmsStudentManageMap
//对集合里的数据进行模糊和分页查询 //对集合里的数据进行模糊和分页查询
if (umsStudentPageQueryDTO.getName() != null){ if (umsStudentPageQueryDTO.getName() != null){
List<UmsStudentManage> umsStudentManageList = umsStudentManages.stream() List<UmsStudentManage> umsStudentManageList = umsStudentManages.stream()
.filter(studentManage -> studentManage.getName().contains(umsStudentPageQueryDTO.getName())) .filter(studentManage ->
studentManage != null &&
studentManage.getName() != null &&
studentManage.getName().contains(umsStudentPageQueryDTO.getName()))
.skip((umsStudentPageQueryDTO.getPage() - 1) * umsStudentPageQueryDTO.getPageSize()) .skip((umsStudentPageQueryDTO.getPage() - 1) * umsStudentPageQueryDTO.getPageSize())
.limit(umsStudentPageQueryDTO.getPageSize()) .limit(umsStudentPageQueryDTO.getPageSize())
.collect(Collectors.toList()); .collect(Collectors.toList());
result.put("Records", umsStudentManageList); result.put("Records", umsStudentManageList);
}else if (umsStudentPageQueryDTO.getNumber() != null){ }else if (umsStudentPageQueryDTO.getNumber() != null){
List<UmsStudentManage> umsStudentManageList = umsStudentManages.stream() List<UmsStudentManage> umsStudentManageList = umsStudentManages.stream()
.filter(studentManage -> studentManage.getNumber().contains(umsStudentPageQueryDTO.getNumber())) .filter(studentManage ->
studentManage != null &&
studentManage.getNumber() != null &&
studentManage.getNumber().contains(umsStudentPageQueryDTO.getNumber()))
.skip((umsStudentPageQueryDTO.getPage() - 1) * umsStudentPageQueryDTO.getPageSize()) .skip((umsStudentPageQueryDTO.getPage() - 1) * umsStudentPageQueryDTO.getPageSize())
.limit(umsStudentPageQueryDTO.getPageSize()) .limit(umsStudentPageQueryDTO.getPageSize())
.collect(Collectors.toList()); .collect(Collectors.toList());

Loading…
Cancel
Save