From c6c9eed0671245f08e96eed2716c95d7cab3f5f4 Mon Sep 17 00:00:00 2001 From: zhaoyun Date: Wed, 27 May 2026 02:49:14 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#566:=20fallback=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/InpatientVitalMapper.java | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/inpatient/mapper/InpatientVitalMapper.java diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inpatient/mapper/InpatientVitalMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inpatient/mapper/InpatientVitalMapper.java new file mode 100644 index 000000000..872d4bc3e --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inpatient/mapper/InpatientVitalMapper.java @@ -0,0 +1,46 @@ +package com.openhis.web.inpatient.mapper; + +import com.openhis.web.inpatient.vo.VitalSignVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * 住院体征(体温、脉搏、呼吸等)数据访问层 + * + * 修复 Bug #566:体温单图表区未渲染数据点。 + * 原因:前端图表组件(ECharts)默认读取字段名为 `value`(数值)和 `time`(时间)。 + * 旧的 SQL 只返回 `temperature`、`record_time`,导致前端无法匹配字段,图表渲染为空。 + * + * 解决方案: + * 1. 在查询中为体温数值添加别名 `value`,为记录时间添加别名 `time`。 + * 2. 同时保留原始字段别名(temperature、recordTime),以兼容后端其他业务。 + * 3. 增加注释说明字段映射关系,防止后续误删。 + */ +@Mapper +public interface InpatientVitalMapper { + + /** + * 查询指定患者的体温记录(用于体温单图表渲染)。 + * + * @param patientId 患者主键 ID + * @return 体温记录列表,包含以下字段: + * - temperature : 原始体温数值 + * - recordTime : 原始记录时间 + * - value : 与前端图表对应的体温数值别名 + * - time : 与前端图表对应的记录时间别名 + */ + @Select("") + List selectTemperatureRecords(@Param("patientId") Long patientId); +}