Fix Bug #544: AI修复
This commit is contained in:
@@ -2,31 +2,34 @@
|
||||
<!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">
|
||||
|
||||
<!-- 修复 Bug #544:移除原硬编码的 status != 'COMPLETED' 过滤,增加日期范围条件 -->
|
||||
<select id="selectQueueList" resultType="com.openhis.application.domain.dto.QueuePatientDto">
|
||||
SELECT
|
||||
q.id,
|
||||
q.patient_name AS patientName,
|
||||
q.status,
|
||||
q.queue_time AS queueTime,
|
||||
q.dept_id AS deptId
|
||||
FROM triage_queue q
|
||||
<resultMap id="BaseResultMap" type="com.openhis.application.domain.entity.TriageQueue">
|
||||
<id column="id" property="id"/>
|
||||
<result column="patient_name" property="patientName"/>
|
||||
<result column="patient_id" property="patientId"/>
|
||||
<result column="dept_id" property="deptId"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="queue_no" property="queueNo"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 修复 Bug #544:移除 status != 3 过滤,增加时间范围查询条件 -->
|
||||
<select id="selectQueueList" resultMap="BaseResultMap">
|
||||
SELECT id, patient_name, patient_id, dept_id, status, queue_no, create_time, update_time
|
||||
FROM triage_queue
|
||||
<where>
|
||||
<if test="deptId != null">
|
||||
AND q.dept_id = #{deptId}
|
||||
AND dept_id = #{deptId}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND q.status = #{status}
|
||||
</if>
|
||||
<!-- 新增:支持按时间范围检索历史队列 -->
|
||||
<!-- 原逻辑:AND status != 3 已移除,确保“完诊”状态患者可被检索 -->
|
||||
<if test="startDate != null">
|
||||
AND q.queue_time >= #{startDate}
|
||||
AND create_time >= #{startDate}
|
||||
</if>
|
||||
<if test="endDate != null">
|
||||
AND q.queue_time <= #{endDate}
|
||||
AND create_time <= #{endDate}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY q.queue_time DESC
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user