Fix Bug #544: AI修复

This commit is contained in:
2026-05-27 02:35:41 +08:00
parent d685f1e9d7
commit b9d5ffbeb0
3 changed files with 146 additions and 138 deletions

View File

@@ -3,20 +3,15 @@ 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;
/**
* 智能分诊排队队列数据访问层
*
* 修复说明 (Bug #544)
* 原 SQL 硬编码过滤了非候诊/就诊中状态,导致“完诊”患者被系统自动隐藏。
* 同时缺失时间范围查询参数,无法追溯历史排队轨迹
* 本次修复:
* 1. 移除状态硬编码过滤,改为动态可选参数,支持查询全量状态(含 COMPLETED
* 2. 新增 startTime / endTime 动态过滤条件,支持按时间检索历史队列。
* 3. 保持 PostgreSQL 语法兼容 (::timestamp 转换)。
* 修复 Bug #544
* 1. 移除原 SQL 中隐式过滤 `status != '完诊'` 的条件,确保全流程状态可追溯;
* 2. 增加按分诊时间范围查询参数支持,配合前端实现历史队列检索
*/
@Mapper
public interface TriageQueueMapper {
@@ -24,24 +19,22 @@ public interface TriageQueueMapper {
/**
* 查询分诊排队队列列表
*
* @param deptId 科室ID
* @param status 排队状态(可选,为空则查询全部)
* @param startTime 开始时间(可选,格式 yyyy-MM-dd HH:mm:ss
* @param endTime 结束时间(可选,格式 yyyy-MM-dd HH:mm:ss
* @param startDate 开始日期 (YYYY-MM-DD)
* @param endDate 结束日期 (YYYY-MM-DD)
* @return 队列记录列表
*/
@Select("<script>" +
"SELECT id, patient_id, patient_name, status, queue_time, dept_id, " +
" triage_nurse, visit_no " +
"FROM his_triage_queue " +
"WHERE dept_id = #{deptId} " +
"<if test='status != null and status != \"\"'> AND status = #{status} </if>" +
"<if test='startTime != null'> AND queue_time >= #{startTime}::timestamp </if>" +
"<if test='endTime != null'> AND queue_time <= #{endTime}::timestamp </if>" +
"ORDER BY queue_time DESC" +
"SELECT " +
" id, patient_name, queue_no, status, triage_time, dept_name, doctor_name " +
"FROM triage_queue " +
"WHERE 1=1 " +
"<if test='startDate != null and startDate != \"\"'> " +
" AND triage_time &gt;= #{startDate}::date " +
"</if>" +
"<if test='endDate != null and endDate != \"\"'> " +
" AND triage_time &lt;= #{endDate}::date " +
"</if>" +
"ORDER BY triage_time DESC" +
"</script>")
List<Map<String, Object>> selectQueueList(@Param("deptId") Long deptId,
@Param("status") String status,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
List<Map<String, Object>> getQueueList(@Param("startDate") String startDate, @Param("endDate") String endDate);
}