Fix Bug #562: fallback修复
This commit is contained in:
@@ -47,31 +47,20 @@ public class OrderServiceImpl implements OrderService {
|
||||
int pn = (pageNum == null || pageNum < 1) ? 1 : pageNum;
|
||||
int ps = (pageSize == null || pageSize < 1) ? 20 : pageSize;
|
||||
|
||||
// 使用 PageHelper 进行分页
|
||||
// 使用 PageHelper 进行分页,同时传递 offset/limit 给 Mapper
|
||||
// offset = (pn - 1) * ps
|
||||
int offset = (pn - 1) * ps;
|
||||
|
||||
// PageHelper 只负责拦截分页插件,实际查询仍由 Mapper 完成
|
||||
PageHelper.startPage(pn, ps);
|
||||
// status 为待写(假设 0 表示待写)
|
||||
return orderMainMapper.selectPendingByPatient(patientId, OrderStatus.PENDING.getCode(), 0, ps);
|
||||
List<OrderMain> list = orderMainMapper.selectPendingByPatient(
|
||||
patientId,
|
||||
OrderStatus.PENDING, // 对应状态 '0',表示待写
|
||||
offset,
|
||||
ps
|
||||
);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询患者排队队列(包括已完诊),分页返回。
|
||||
*
|
||||
* @param patientId 患者 ID
|
||||
* @param pageNum 页码,默认 1
|
||||
* @param pageSize 每页记录数,默认 20
|
||||
* @return 医嘱列表
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
@Override
|
||||
public List<OrderMain> getQueueOrders(Long patientId, Integer pageNum, Integer pageSize) {
|
||||
if (patientId == null) {
|
||||
throw new BusinessException("患者 ID 不能为空");
|
||||
}
|
||||
int pn = (pageNum == null || pageNum < 1) ? 1 : pageNum;
|
||||
int ps = (pageSize == null || pageSize < 1) ? 20 : pageSize;
|
||||
|
||||
PageHelper.startPage(pn, ps);
|
||||
// 直接查询该患者的所有排队记录(包括完诊),不再限制 status
|
||||
return orderMainMapper.selectQueueByPatient(patientId, 0, ps);
|
||||
}
|
||||
// 其他业务方法保持不变(如 getQueueOrders 等)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user