diff --git a/src/main/java/com/syjiaer/clinic/server/service/patient/PatientInfoService.java b/src/main/java/com/syjiaer/clinic/server/service/patient/PatientInfoService.java index d2a2c2d..c78492a 100644 --- a/src/main/java/com/syjiaer/clinic/server/service/patient/PatientInfoService.java +++ b/src/main/java/com/syjiaer/clinic/server/service/patient/PatientInfoService.java @@ -208,7 +208,19 @@ public class PatientInfoService extends BaseService { queryWrapper.or().like("phone",keyword); queryWrapper.or().like("cert_no",keyword); } - return pageHelper(pageNum, pageSize, queryWrapper, patientInfoMapper, "create_datetime", false); + + Long totalCount = patientInfoMapper.selectCount(queryWrapper); + queryWrapper.orderByDesc("last_visit_time IS NOT NULL"); + queryWrapper.orderByDesc("last_visit_time"); + queryWrapper.last("LIMIT " + pageSize + " OFFSET " + (pageNum - 1) * pageSize); + List list = patientInfoMapper.selectList(queryWrapper); + Page page = new Page<>(); + page.setList(list); + page.setTotal_count(totalCount); + page.setTotal_page((int) Math.ceil(totalCount / (double) pageSize)); + + + return page; } public PatientInfo getById(int id) { @@ -270,4 +282,7 @@ public class PatientInfoService extends BaseService { } patientInfoMapper.updateById(patientList); } + + + }