fix(#SQL-UNION): AdviceManageAppMapper UNION 查询列顺序不一致导致类型不匹配
根因: - 第一分支(用药医嘱)的列顺序为 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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user