Fix Bug #544: AI修复
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package com.openhis.web.outpatient.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 智能分诊排队队列 Mapper
|
||||
*
|
||||
* 修复 Bug #544:
|
||||
* 1. 移除原 SQL 中隐式过滤 'COMPLETED'/'完诊' 状态的 WHERE 条件,确保全流程状态可追溯。
|
||||
* 2. 增加 startDate 与 endDate 动态查询参数,支持历史队列按时间范围检索。
|
||||
*/
|
||||
@Mapper
|
||||
public interface TriageQueueMapper {
|
||||
|
||||
@Select("<script>" +
|
||||
"SELECT " +
|
||||
" id, patient_name, patient_no, queue_status, dept_name, " +
|
||||
" triage_time, create_time, update_time " +
|
||||
"FROM outp_triage_queue " +
|
||||
"WHERE 1=1 " +
|
||||
"<if test='status != null and status != \"\"'>" +
|
||||
" AND queue_status = #{status} " +
|
||||
"</if>" +
|
||||
"<if test='startDate != null'>" +
|
||||
" AND create_time >= #{startDate}::timestamp " +
|
||||
"</if>" +
|
||||
"<if test='endDate != null'>" +
|
||||
" AND create_time <= #{endDate}::timestamp + interval '1 day' " +
|
||||
"</if>" +
|
||||
"ORDER BY create_time DESC" +
|
||||
"</script>")
|
||||
List<Map<String, Object>> selectQueueList(@Param("status") String status,
|
||||
@Param("startDate") String startDate,
|
||||
@Param("endDate") String endDate);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.openhis.web.outpatient.service.impl;
|
||||
|
||||
import com.openhis.web.outpatient.mapper.TriageQueueMapper;
|
||||
import com.openhis.web.outpatient.service.TriageQueueService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 智能分诊排队业务实现
|
||||
*
|
||||
* 修复 Bug #544:
|
||||
* 增加日期范围参数处理逻辑,若前端未传时间则默认查询当天数据,满足“默认当天时间”需求。
|
||||
*/
|
||||
@Service
|
||||
public class TriageQueueServiceImpl implements TriageQueueService {
|
||||
|
||||
private final TriageQueueMapper queueMapper;
|
||||
|
||||
public TriageQueueServiceImpl(TriageQueueMapper queueMapper) {
|
||||
this.queueMapper = queueMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getQueueList(String status, String startDate, String endDate) {
|
||||
// 默认查询当天,支持历史范围覆盖
|
||||
String effectiveStart = (startDate == null || startDate.isBlank()) ? LocalDate.now().toString() : startDate;
|
||||
String effectiveEnd = (endDate == null || endDate.isBlank()) ? LocalDate.now().toString() : endDate;
|
||||
|
||||
return queueMapper.selectQueueList(status, effectiveStart, effectiveEnd);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user