This commit is contained in:
LiJianZhao 2025-05-07 12:08:24 +08:00
parent 5964502e59
commit e2989fd399
1 changed files with 16 additions and 1 deletions

View File

@ -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<PatientInfo> list = patientInfoMapper.selectList(queryWrapper);
Page<PatientInfo> 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);
}
}