From 3cdab2c6fca8645f28e4508c4e7e627893b521f8 Mon Sep 17 00:00:00 2001 From: chenqi Date: Mon, 22 Jun 2026 09:57:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(db):=20V100=E8=BF=81=E7=A7=BB=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E7=A7=BB=E9=99=A4update=5Ftime=E5=88=97=E5=BC=95?= =?UTF-8?q?=E7=94=A8=EF=BC=8C=E9=81=BF=E5=85=8DV103=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V100__sync_existing_emr_data.sql | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V100__sync_existing_emr_data.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V100__sync_existing_emr_data.sql index 4a0faef2d..db39aa853 100644 --- a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V100__sync_existing_emr_data.sql +++ b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V100__sync_existing_emr_data.sql @@ -28,11 +28,11 @@ WHERE e.id IS NOT NULL SELECT 1 FROM emr_revision r WHERE r.emr_id = e.id ); --- 3. 从doc_emr同步搜索索引 +-- 3. 从doc_emr同步搜索索引(不包含update_time列,因为V103才添加) INSERT INTO emr_search_index ( id, emr_id, encounter_id, patient_id, patient_name, emr_type, emr_title, diagnosis_text, - doctor_name, department_name, create_time, update_time + doctor_name, department_name, create_time ) SELECT nextval('emr_search_index_id_seq'), @@ -65,8 +65,7 @@ SELECT ), COALESCE(u.name, '医生' || e.record_id), COALESCE(o.name, '未知科室'), - COALESCE(e.create_time, NOW()), - COALESCE(e.update_time, NOW()) + COALESCE(e.create_time, NOW()) FROM doc_emr e LEFT JOIN patient p ON e.patient_id = p.id LEFT JOIN sys_user u ON e.record_id = u.user_id