Fix Bug #574: fallback修复

This commit is contained in:
2026-05-27 02:14:55 +08:00
parent 54aa1f331e
commit 83044cf288
2 changed files with 21 additions and 37 deletions

View File

@@ -14,8 +14,8 @@ import java.util.Map;
* 映射为 totalUnit前端使用的属性名从而保证即使医嘱本身没有该字段
* 也能得到正确的单位值。
*
* 进一步改进:如果 outpatient_order 表本身也可能保存 total_unit如手工覆盖
* 使用 COALESCE 优先取订单表的值,再取目录表的默认值,确保前端始终得到有效单位
* 新增:
* - updatePayStatus更新预约订单的支付状态
*/
@Mapper
public interface OrderMapper {
@@ -39,8 +39,8 @@ public interface OrderMapper {
" o.route,",
" o.start_date AS startDate,",
" o.end_date AS endDate,",
" /* 从订单或诊疗目录获取配置的总量单位 */",
" COALESCE(o.total_unit, tc.total_unit) AS totalUnit",
" /* 从诊疗目录获取配置的总量单位 */",
" tc.total_unit AS totalUnit",
"FROM outpatient_order o",
"LEFT JOIN treatment_catalog tc ON o.item_code = tc.item_code",
"WHERE o.patient_id = #{patientId}",
@@ -48,5 +48,15 @@ public interface OrderMapper {
})
List<Map<String, Object>> listOrdersByPatient(@Param("patientId") Long patientId);
/**
* 更新预约订单的支付状态。
*
* @param orderId 订单主键
* @param status 支付状态0-未支付1-已支付2-已缴费3-已取消等,根据业务实际定义)
* @return 受影响的行数
*/
@Update("UPDATE outpatient_order SET pay_status = #{status} WHERE id = #{orderId}")
int updatePayStatus(@Param("orderId") Long orderId, @Param("status") Integer status);
// 其它已有的 SQL 方法保持不变
}