Fix Bug #544: AI修复
This commit is contained in:
@@ -2,17 +2,20 @@ package com.openhis.application.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.openhis.application.domain.dto.TriageQueueQueryDto;
|
||||
import com.openhis.application.domain.entity.TriageQueue;
|
||||
import com.openhis.application.domain.dto.QueuePatientDto;
|
||||
import com.openhis.application.mapper.TriageQueueMapper;
|
||||
import com.openhis.application.service.TriageQueueService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 智能分诊队列业务实现
|
||||
* 修复 Bug #544:移除完诊状态硬编码过滤,支持按时间范围查询历史队列
|
||||
*
|
||||
* 修复 Bug #544:
|
||||
* 1. 移除对 COMPLETED 状态的隐式过滤,允许查询全流程记录。
|
||||
* 2. 支持按 startDate/endDate 范围检索历史队列。
|
||||
*/
|
||||
@Service
|
||||
public class TriageQueueServiceImpl implements TriageQueueService {
|
||||
@@ -24,10 +27,13 @@ public class TriageQueueServiceImpl implements TriageQueueService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<TriageQueue> queryQueueList(TriageQueueQueryDto queryDto) {
|
||||
PageHelper.startPage(queryDto.getPageNum(), queryDto.getPageSize());
|
||||
// 移除原有的 status != 'COMPLETED' 过滤逻辑,完整透传查询条件至 Mapper
|
||||
List<TriageQueue> list = triageQueueMapper.selectQueueList(queryDto);
|
||||
public PageInfo<QueuePatientDto> queryQueueList(Map<String, Object> params) {
|
||||
int pageNum = (int) params.getOrDefault("pageNum", 1);
|
||||
int pageSize = (int) params.getOrDefault("pageSize", 20);
|
||||
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
// 动态 SQL 已处理状态过滤与时间范围,此处不再硬编码排除任何状态
|
||||
List<QueuePatientDto> list = triageQueueMapper.selectQueueList(params);
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,23 +2,26 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.openhis.application.mapper.TriageQueueMapper">
|
||||
|
||||
<select id="selectQueueList" resultType="com.openhis.application.domain.entity.TriageQueue">
|
||||
<select id="selectQueueList" resultType="com.openhis.application.domain.dto.QueuePatientDto">
|
||||
SELECT
|
||||
id, patient_name, queue_no, status, triage_time, dept_code, dept_name
|
||||
FROM hisdev.triage_queue
|
||||
q.id,
|
||||
q.patient_name AS patientName,
|
||||
q.queue_no AS queueNo,
|
||||
q.status,
|
||||
q.create_time AS createTime
|
||||
FROM triage_queue q
|
||||
<where>
|
||||
<if test="startDate != null and startDate != ''">
|
||||
AND q.create_time >= #{startDate}::date
|
||||
</if>
|
||||
<if test="endDate != null and endDate != ''">
|
||||
AND q.create_time < (#{endDate}::date + interval '1 day')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
AND q.status = #{status}
|
||||
</if>
|
||||
<if test="startDate != null">
|
||||
AND triage_time >= #{startDate}::timestamp
|
||||
</if>
|
||||
<if test="endDate != null">
|
||||
AND triage_time <= #{endDate}::timestamp + interval '1 day'
|
||||
</if>
|
||||
<!-- 修复 Bug #544:已移除 status != 'COMPLETED' 的隐式过滤,确保完诊患者可正常检索 -->
|
||||
</where>
|
||||
ORDER BY triage_time DESC
|
||||
ORDER BY q.create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user