diff --git a/com/openhis/web/outpatient/mapper/OrderMapper.java b/com/openhis/web/outpatient/mapper/OrderMapper.java index 401778209..17c1f4f0a 100644 --- a/com/openhis/web/outpatient/mapper/OrderMapper.java +++ b/com/openhis/web/outpatient/mapper/OrderMapper.java @@ -47,32 +47,44 @@ public interface OrderMapper { *(对应数据库列 {@code total_unit})。原始的 {@code SELECT *} 只能映射到 {@code total_unit},导致 * 前端得到 {@code null}。此查询通过别名把 {@code total_unit_name} 映射为 {@code total_unit}, * 从而保证前端能够正确显示。
+ * + * @param orderId 医嘱主键 + * @return 包含医嘱详情的 Map,关键字段 {@code total_unit} 已正确映射 */ - @Select("SELECT o.*, d.total_unit_name AS total_unit " + + @Select("SELECT " + + " o.id, " + + " o.patient_id, " + + " o.doctor_id, " + + " o.order_status, " + + " o.total_quantity, " + + " o.total_unit, " + // 原字段(可能为空) + " d.total_unit_name AS total_unit, " + // 诊疗目录配置的单位,覆盖为 total_unit + " o.create_time, " + + " o.update_time " + "FROM his_order o " + - "LEFT JOIN diagnosis_detail d ON o.diagnosis_id = d.id " + + "LEFT JOIN his_diagnosis_catalog d ON o.catalog_id = d.id " + "WHERE o.id = #{orderId}") Map