From b888dc33acc078ec1ff033ece859e2eb6e52bdb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=B3=E7=BE=BD?= <关羽@gentronhealth.com> Date: Sat, 16 May 2026 19:12:07 +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?= =?UTF-8?q?=E8=AF=B7=E5=8D=95=E7=8A=B6=E6=80=81"=E5=88=97=E5=8F=8A?= =?UTF-8?q?=E5=85=A8=E6=B5=81=E7=A8=8B=E9=97=AD=E7=8E=AF=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=B5=81=E8=BD=AC=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:Mapper XML 中 desc_json 使用复杂的 CASE + MIN(wsr.org_id) 聚合表达式处理发往科室回显, 但 doc_request_form 表已有 status 字段直接存储状态值,CASE 表达式在多条 ServiceRequest 记录 场景下产生不必要的聚合开销且逻辑冗余。 修复:简化 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,