Fix Bug #544: fallback修复
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.QueueInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 智能分诊排队队列数据访问层
|
||||
*
|
||||
* 修复 Bug #544:
|
||||
* 1. 在查询当前排队列表时,加入对 “完诊”(status = 'FINISHED') 状态患者的展示;
|
||||
* 2. 新增历史队列查询接口,用于查询已完成或已取消的排队记录。
|
||||
*/
|
||||
public interface QueueMapper {
|
||||
|
||||
/**
|
||||
* 查询当前排队列表(包括待诊、已诊、完诊)。
|
||||
*
|
||||
* @param departmentId 科室ID(可为空,表示查询全部)
|
||||
* @return 当前排队的患者列表
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT q.* FROM adm_queue_info q " +
|
||||
"WHERE 1=1 " +
|
||||
"<if test='departmentId != null'> AND q.department_id = #{departmentId}</if> " +
|
||||
// 原来的实现只过滤 status IN ('WAIT','DIAGNOSE'),现在加入 'FINISHED'
|
||||
"AND q.status IN ('WAIT','DIAGNOSE','FINISHED') " +
|
||||
"ORDER BY q.queue_no ASC" +
|
||||
"</script>")
|
||||
List<QueueInfo> selectCurrentQueue(@Param("departmentId") Long departmentId);
|
||||
|
||||
/**
|
||||
* 查询历史排队记录(已完成或已取消)。
|
||||
*
|
||||
* @param departmentId 科室ID(可为空)
|
||||
* @param startTime 起始时间(可为空)
|
||||
* @param endTime 结束时间(可为空)
|
||||
* @return 符合条件的历史排队记录
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT q.* FROM adm_queue_info q " +
|
||||
"WHERE q.status IN ('FINISHED','CANCELLED') " +
|
||||
"<if test='departmentId != null'> AND q.department_id = #{departmentId}</if> " +
|
||||
"<if test='startTime != null'> AND q.create_time >= #{startTime}</if> " +
|
||||
"<if test='endTime != null'> AND q.create_time <= #{endTime}</if> " +
|
||||
"ORDER BY q.create_time DESC" +
|
||||
"</script>")
|
||||
List<QueueInfo> selectHistoryQueue(@Param("departmentId") Long departmentId,
|
||||
@Param("startTime") java.util.Date startTime,
|
||||
@Param("endTime") java.util.Date endTime);
|
||||
}
|
||||
Reference in New Issue
Block a user