Fix Bug #544: fallback修复

This commit is contained in:
2026-05-27 05:24:49 +08:00
parent 8f076f728e
commit 016b9fec41
4 changed files with 219 additions and 74 deletions

View File

@@ -0,0 +1,75 @@
package com.openhis.application.mapper;
import com.openhis.application.domain.dto.QueuePatientDto;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.Date;
import java.util.List;
/**
* OrderMainMapper - 新增查询方法以支持排队列表与历史查询
*/
public interface OrderMainMapper {
/**
* 查询当前排队患者(包括等待、进行中、已完诊)。
*
* @param departmentId 科室ID
* @param statuses 需要过滤的状态数组
* @return QueuePatientDto 列表
*/
@Select({
"<script>",
"SELECT",
" om.id AS patientId,",
" om.patient_name AS patientName,",
" om.status AS status,",
" om.queue_number AS queueNumber,",
" om.register_time AS registerTime",
"FROM order_main om",
"WHERE om.department_id = #{departmentId}",
" AND om.status IN",
" <foreach item='s' collection='statuses' open='(' separator=',' close=')'>",
" #{s}",
" </foreach>",
"ORDER BY om.register_time ASC",
"</script>"
})
List<QueuePatientDto> selectQueuePatients(@Param("departmentId") Integer departmentId,
@Param("statuses") String[] statuses);
/**
* 查询历史排队记录(不分页),支持时间范围过滤。
*
* @param departmentId 科室ID可为 null
* @param startDate 起始时间,可为 null
* @param endDate 结束时间,可为 null
* @return 历史记录列表
*/
@Select({
"<script>",
"SELECT",
" om.id AS patientId,",
" om.patient_name AS patientName,",
" om.status AS status,",
" om.queue_number AS queueNumber,",
" om.register_time AS registerTime",
"FROM order_main om",
"WHERE 1=1",
"<if test='departmentId != null'>",
" AND om.department_id = #{departmentId}",
"</if>",
"<if test='startDate != null'>",
" AND om.register_time &gt;= #{startDate}",
"</if>",
"<if test='endDate != null'>",
" AND om.register_time &lt;= #{endDate}",
"</if>",
"ORDER BY om.register_time DESC",
"</script>"
})
List<QueuePatientDto> selectQueueHistory(@Param("departmentId") Integer departmentId,
@Param("startDate") Date startDate,
@Param("endDate") Date endDate);
}