From b98ffaf2834dce0bbefa6e5fdd2fe9bab4a9fb4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=8E=E4=BD=97?= Date: Fri, 29 May 2026 11:19:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(#SQL-UNION):=20AdviceManageAppMapper=20UNIO?= =?UTF-8?q?N=20=E6=9F=A5=E8=AF=A2=E5=88=97=E9=A1=BA=E5=BA=8F=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4=E5=AF=BC=E8=87=B4=E7=B1=BB=E5=9E=8B=E4=B8=8D?= =?UTF-8?q?=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因: - 第一分支(用药医嘱)的列顺序为 start_time, therapyEnum, sort_number - 第二/三分支(设备/服务医嘱)的列顺序为 therapyEnum, sort_number, start_time - UNION 时 PostgreSQL 校验第 30 位列发现 timestamp vs integer 类型冲突 修复: - 将第一分支的 start_time 移到 therapyEnum 和 sort_number 之后 - 三个分支列顺序现在完全对齐 报错: UNION types timestamp with time zone and integer cannot be matched --- .../mapper/regdoctorstation/AdviceManageAppMapper.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/AdviceManageAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/AdviceManageAppMapper.xml index fc86b35cf..723d64929 100755 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/AdviceManageAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/AdviceManageAppMapper.xml @@ -214,9 +214,9 @@ T1.dispense_per_duration AS dispense_per_duration, T2.part_percent AS part_percent, ccd.name AS condition_definition_name, - T1.effective_dose_start AS start_time, T1.therapy_enum AS therapyEnum, T1.sort_number AS sort_number, + T1.effective_dose_start AS start_time, T1.based_on_id AS based_on_id, T1.medication_id AS advice_definition_id, T1.effective_dose_end AS stop_time, @@ -275,7 +275,7 @@ T1.req_authored_time AS start_time, T1.based_on_id AS based_on_id, T1.device_def_id AS advice_definition_id, - NULL AS stop_time, + NULL::timestamp AS stop_time, '' AS stop_user_name FROM wor_device_request AS T1 LEFT JOIN adm_device_definition AS T2 ON T2.ID = T1.device_def_id