Fix Bug #544: AI修复
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package com.openhis.application.service.impl;
|
||||
|
||||
import com.openhis.application.mapper.TriageQueueMapper;
|
||||
import com.openhis.application.domain.entity.TriageQueue;
|
||||
import com.openhis.application.service.TriageQueueService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class TriageQueueServiceImpl implements TriageQueueService {
|
||||
|
||||
private final TriageQueueMapper triageQueueMapper;
|
||||
|
||||
public TriageQueueServiceImpl(TriageQueueMapper triageQueueMapper) {
|
||||
this.triageQueueMapper = triageQueueMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分诊队列列表
|
||||
* 修复 Bug #544:移除原有对 status 的硬编码过滤,支持查询全量状态(含完诊);
|
||||
* 增加按日期范围查询能力,默认查询当天。
|
||||
*/
|
||||
@Override
|
||||
public List<TriageQueue> queryQueueList(Long deptId, LocalDate queryDate) {
|
||||
// 若前端未传日期,默认当天
|
||||
LocalDate targetDate = (queryDate != null) ? queryDate : LocalDate.now();
|
||||
LocalDateTime startOfDay = LocalDateTime.of(targetDate, LocalTime.MIN);
|
||||
LocalDateTime endOfDay = LocalDateTime.of(targetDate, LocalTime.MAX);
|
||||
|
||||
return triageQueueMapper.selectQueueByDeptAndDate(deptId, startOfDay, endOfDay);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!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">
|
||||
|
||||
<resultMap id="TriageQueueResult" type="com.openhis.application.domain.entity.TriageQueue">
|
||||
<id property="id" column="id"/>
|
||||
<result property="patientId" column="patient_id"/>
|
||||
<result property="patientName" column="patient_name"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="queueTime" column="queue_time"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 修复 Bug #544:移除 status != 3 或 status IN (...) 的过滤逻辑,开放全状态查询 -->
|
||||
<select id="selectQueueByDeptAndDate" resultMap="TriageQueueResult">
|
||||
SELECT
|
||||
id, patient_id, patient_name, status, dept_id, queue_time
|
||||
FROM his_triage_queue
|
||||
<where>
|
||||
<if test="deptId != null">
|
||||
AND dept_id = #{deptId}
|
||||
</if>
|
||||
<if test="startTime != null">
|
||||
AND queue_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
AND queue_time <= #{endTime}
|
||||
</if>
|
||||
AND del_flag = 0
|
||||
</where>
|
||||
ORDER BY queue_time ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user