Fix Bug #562: fallback修复
This commit is contained in:
@@ -16,6 +16,7 @@ import java.util.Map;
|
||||
*
|
||||
* 新增:
|
||||
* - updatePayStatus:更新预约订单的支付状态。
|
||||
* - listOrdersByPatientPaged:为门诊医生工作站的“待写病历”列表提供分页查询,避免一次性加载大量数据导致页面卡顿。
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderMapper {
|
||||
@@ -48,15 +49,46 @@ public interface OrderMapper {
|
||||
})
|
||||
List<Map<String, Object>> listOrdersByPatient(@Param("patientId") Long patientId);
|
||||
|
||||
/**
|
||||
* 分页查询门诊医嘱列表(含总量单位),用于“待写病历”页面。
|
||||
*
|
||||
* @param patientId 患者 ID
|
||||
* @param offset 数据偏移量(从0开始)
|
||||
* @param limit 每页记录数
|
||||
* @return 医嘱列表,每条记录包含 totalUnit 字段
|
||||
*/
|
||||
@Select({
|
||||
"<script>",
|
||||
"SELECT o.id,",
|
||||
" o.patient_id AS patientId,",
|
||||
" o.doctor_id AS doctorId,",
|
||||
" o.item_code AS itemCode,",
|
||||
" o.item_name AS itemName,",
|
||||
" o.quantity,",
|
||||
" o.dosage,",
|
||||
" o.frequency,",
|
||||
" o.route,",
|
||||
" o.start_date AS startDate,",
|
||||
" o.end_date AS endDate,",
|
||||
" 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}",
|
||||
"ORDER BY o.id ASC",
|
||||
"LIMIT #{limit} OFFSET #{offset}",
|
||||
"</script>"
|
||||
})
|
||||
List<Map<String, Object>> listOrdersByPatientPaged(@Param("patientId") Long patientId,
|
||||
@Param("offset") int offset,
|
||||
@Param("limit") int limit);
|
||||
|
||||
/**
|
||||
* 更新预约订单的支付状态。
|
||||
*
|
||||
* @param orderId 订单主键
|
||||
* @param status 支付状态(0-未支付,1-已支付,2-已缴费,3-已取消等,根据业务实际定义)
|
||||
* @param orderId 预约订单ID
|
||||
* @param status 支付状态码
|
||||
* @return 受影响的行数
|
||||
*/
|
||||
@Update("UPDATE outpatient_order SET pay_status = #{status} WHERE id = #{orderId}")
|
||||
int updatePayStatus(@Param("orderId") Long orderId, @Param("status") Integer status);
|
||||
|
||||
// 其它已有的 SQL 方法保持不变
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user