From 2cdda279a4bfc5bd85748e46ed4a1d4223927a49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=BA=91?= <赵云@gentronhealth.com> Date: Thu, 14 May 2026 18:12:48 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#435:=20=E9=97=A8=E8=AF=8A=E6=89=8B?= =?UTF-8?q?=E6=9C=AF=E5=AE=89=E6=8E=92=EF=BC=9A=E7=BC=96=E8=BE=91=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E4=B8=AD"=E8=B4=B9=E7=94=A8=E7=B1=BB=E5=88=AB"?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=95=B0=E6=8D=AE=E6=9C=AA=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:getSurgeryScheduleDetail 的 SQL 查询中引用了 fc.contract_name 但 未 JOIN fin_contract 表(以及关联的 adm_encounter、adm_account),导致 PostgreSQL 报错 "missing FROM-clause entry for table fc",接口返回失败, 前端费用类别字段无法获取数据。 修复:添加缺失的三表 JOIN(adm_encounter → adm_account → fin_contract), 并移除重复的 os.fee_type AS feeType 别名。 Co-Authored-By: Claude Opus 4.7 --- .../mapper/clinicalmanage/SurgicalScheduleAppMapper.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/clinicalmanage/SurgicalScheduleAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/clinicalmanage/SurgicalScheduleAppMapper.xml index 74abd7a4f..852f2759d 100755 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/clinicalmanage/SurgicalScheduleAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/clinicalmanage/SurgicalScheduleAppMapper.xml @@ -91,13 +91,15 @@ os.surgery_nature AS surgeryType, cs.incision_level AS incisionLevel, fc.contract_name AS feeType, - os.fee_type AS feeType, COALESCE(pi.identifier_no, ap.bus_no, '') AS identifierNo FROM op_schedule os LEFT JOIN adm_patient ap ON os.patient_id = ap.id INNER JOIN cli_surgery cs ON os.oper_code = cs.surgery_no AND cs.delete_flag = '0' LEFT JOIN adm_organization o ON cs.org_id = o.id LEFT JOIN doc_request_form drf ON drf.prescription_no=cs.surgery_no + LEFT JOIN adm_encounter ae ON ae.id = os.visit_id AND ae.delete_flag = '0' + LEFT JOIN adm_account aa ON aa.encounter_id = ae.id AND aa.delete_flag = '0' + LEFT JOIN fin_contract fc ON fc.bus_no = aa.contract_no AND fc.delete_flag = '0' LEFT JOIN ( SELECT patient_id, identifier_no FROM (