From 2d2fa647721feea8923e3f6771a79fa926a850ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8D=80=E5=BD=A7?= <荀彧@gentronhealth.com> Date: Fri, 15 May 2026 00:26:23 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#498:=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=8A=B6=E6=80=81=E7=AD=9B=E9=80=89?= =?UTF-8?q?HAVING=E5=AD=90=E5=8F=A5=E4=B8=8ESELECT=E6=98=A0=E5=B0=84?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4=E5=AF=BC=E8=87=B4=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SELECT的CASE映射将status_enum=4映射为3(待接收),但HAVING子句将status_enum=4映射为4, 导致按"待接收"或"已接收"状态筛选时无结果返回。同时修正status_enum=5/6/7的映射从5→7。 Co-Authored-By: Claude Opus 4.7 --- .../RequestFormManageAppMapper.xml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 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 71c63a34a..5443eff69 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 @@ -61,15 +61,14 @@ GROUP BY drf.id, drf.encounter_id, drf.prescription_no, drf.name, drf.desc_json, drf.requester_id, drf.create_time, ap.name - HAVING CASE MIN(wsr.status_enum) - WHEN 1 THEN 0 - WHEN 2 THEN 1 - WHEN 3 THEN 4 - WHEN 4 THEN 4 - WHEN 5 THEN 5 - WHEN 6 THEN 5 - WHEN 7 THEN 5 - WHEN 8 THEN 6 + HAVING CASE + WHEN MIN(wsr.status_enum) = 1 THEN 0 + WHEN MIN(wsr.status_enum) = 2 THEN 1 + WHEN MIN(wsr.status_enum) = 3 AND MAX(CASE WHEN wsr.performer_check_id IS NOT NULL THEN 1 ELSE 0 END) = 1 THEN 2 + WHEN MIN(wsr.status_enum) = 3 THEN 4 + WHEN MIN(wsr.status_enum) = 4 THEN 3 + WHEN MIN(wsr.status_enum) = 5 OR MIN(wsr.status_enum) = 6 OR MIN(wsr.status_enum) = 7 THEN 7 + WHEN MIN(wsr.status_enum) = 8 THEN 6 ELSE NULL END = #{status}::integer