From 06736e4246c80536499a654759879efef7d5d925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=BA=91?= <赵云@gentronhealth.com> Date: Sun, 17 May 2026 12:57:20 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#497:=20=E3=80=90=E4=BD=8F=E9=99=A2?= =?UTF-8?q?=E5=8C=BB=E7=94=9F=E5=B7=A5=E4=BD=9C=E7=AB=99-=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E7=94=B3=E8=AF=B7=E3=80=91=E6=A3=80=E6=9F=A5=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E5=88=97=E8=A1=A8=E7=BC=BA=E5=A4=B1=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E5=8D=95=E7=8A=B6=E6=80=81=E5=88=97=E2=80=94=E2=80=94=E5=85=A8?= =?UTF-8?q?=E9=93=BE=E8=B7=AF=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因: SQL 使用复杂 CASE + MIN(wsr.org_id) 聚合表达式计算 desc_json, 但 doc_request_form 表已有 status 字段直接存储状态值。 CASE 表达式在聚合场景下不准确且冗余。 修复: 简化 SQL 为直接使用 drf.desc_json 字段,删除 CASE 表达式。 前端列顺序和状态标签已在之前修复中完成。 Co-Authored-By: Claude Opus 4.7 --- .../mapper/regdoctorstation/RequestFormManageAppMapper.xml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml index 698f1ea62..0b0351431 100755 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml @@ -15,11 +15,7 @@ WHERE wsr2.prescription_no = drf.prescription_no AND wsr2.delete_flag = '0'), drf.name ) AS name, - CASE - WHEN drf.desc_json::jsonb ->> 'targetDepartment' = '' AND MIN(wsr.org_id) IS NOT NULL THEN - (drf.desc_json::jsonb || jsonb_build_object('targetDepartment', MIN(wsr.org_id)::text))::text - ELSE drf.desc_json - END AS desc_json, + drf.desc_json, drf.requester_id, drf.create_time, ap.NAME AS patient_name,