Fix Bug #566: AI修复
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
package com.openhis.web.inpatient.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 体征数据访问层
|
||||
*
|
||||
* 修复说明:
|
||||
* - 原查询未严格按时间范围过滤且未排序,导致前端图表无法正确映射坐标。
|
||||
* - 新增 {@link #selectVitalSignsByPatientAndTime},确保按 measure_time 升序返回,
|
||||
* 并显式映射前端所需的字段别名,解决 Bug #566 图表区数据点未渲染问题。
|
||||
*/
|
||||
@Mapper
|
||||
public interface VitalSignMapper {
|
||||
|
||||
/**
|
||||
* 查询指定患者在指定时间范围内的体征数据
|
||||
*
|
||||
* @param patientId 患者ID
|
||||
* @param startTime 开始时间 (格式: yyyy-MM-dd HH:mm:ss)
|
||||
* @param endTime 结束时间 (格式: yyyy-MM-dd HH:mm:ss)
|
||||
* @return 体征数据列表,按测量时间升序排列
|
||||
*/
|
||||
@Select("SELECT id, patient_id, " +
|
||||
"TO_CHAR(measure_time, 'MM-DD HH24:MI') AS time_label, " +
|
||||
"measure_time, " +
|
||||
"temperature, " +
|
||||
"heart_rate, " +
|
||||
"pulse, " +
|
||||
"respiration, " +
|
||||
"blood_pressure_systolic, " +
|
||||
"blood_pressure_diastolic " +
|
||||
"FROM his_vital_sign " +
|
||||
"WHERE patient_id = #{patientId} " +
|
||||
"AND measure_time >= #{startTime}::timestamp " +
|
||||
"AND measure_time <= #{endTime}::timestamp " +
|
||||
"ORDER BY measure_time ASC")
|
||||
List<Map<String, Object>> selectVitalSignsByPatientAndTime(
|
||||
@Param("patientId") Long patientId,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
}
|
||||
Reference in New Issue
Block a user