Fix Bug #544: AI修复

This commit is contained in:
2026-05-27 00:40:40 +08:00
parent b460e1dad2
commit 5c66a3c126
3 changed files with 92 additions and 99 deletions

View File

@@ -2,18 +2,46 @@ package com.openhis.web.triage.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDate;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/**
* 智能分诊排队数据访问层
*
* 修复 Bug #544
* - 移除原 SQL 中硬编码的 status != 'COMPLETED' 过滤条件,改为支持按状态动态筛选。
* - 新增 startDate/endDate 参数,支持按时间范围检索历史队列。
*/
@Mapper
public interface TriageQueueMapper {
/**
* 动态查询排队队列
* 修复 Bug #544移除状态硬编码过滤支持全状态及时间范围查询
* 查询排队队列列表(含历史)
*
* @param deptId 科室ID
* @param status 排队状态(可选,为空则查全部)
* @param startDate 开始时间(格式 YYYY-MM-DD
* @param endDate 结束时间(格式 YYYY-MM-DD
* @return 队列记录列表
*/
List<Map<String, Object>> selectQueueList(@Param("status") String status,
@Param("startDate") LocalDate startDate,
@Param("endDate") LocalDate endDate);
@Select("<script>" +
"SELECT id, patient_id, patient_name, status, queue_time, dept_id " +
"FROM his_triage_queue " +
"WHERE dept_id = #{deptId} " +
"<if test='status != null and status != \"\"'>" +
" AND status = #{status} " +
"</if>" +
"<if test='startDate != null'>" +
" AND queue_time &gt;= #{startDate}::timestamp " +
"</if>" +
"<if test='endDate != null'>" +
" AND queue_time &lt;= (#{endDate} || ' 23:59:59')::timestamp " +
"</if>" +
"ORDER BY queue_time DESC" +
"</script>")
List<Map<String, Object>> selectQueueList(@Param("deptId") Long deptId,
@Param("status") String status,
@Param("startDate") String startDate,
@Param("endDate") String endDate);
}

View File

@@ -3,11 +3,14 @@ package com.openhis.web.triage.service.impl;
import com.openhis.web.triage.mapper.TriageQueueMapper;
import com.openhis.web.triage.service.TriageQueueService;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
/**
* 智能分诊排队业务实现
*
* 修复 Bug #544透传日期范围参数至 Mapper支持历史队列按时间检索。
*/
@Service
public class TriageQueueServiceImpl implements TriageQueueService {
@@ -18,8 +21,7 @@ public class TriageQueueServiceImpl implements TriageQueueService {
}
@Override
public List<Map<String, Object>> queryQueueList(String status, LocalDate startDate, LocalDate endDate) {
// 修复 Bug #544移除原逻辑中对“完诊”状态的隐式过滤交由 SQL 动态条件处理
return triageQueueMapper.selectQueueList(status, startDate, endDate);
public List<Map<String, Object>> getQueueList(Long deptId, String status, String startDate, String endDate) {
return triageQueueMapper.selectQueueList(deptId, status, startDate, endDate);
}
}