40 lines
1.3 KiB
Java
40 lines
1.3 KiB
Java
package com.openhis.web.inpatient.mapper;
|
|
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
import org.apache.ibatis.annotations.Param;
|
|
import org.apache.ibatis.annotations.Update;
|
|
|
|
/**
|
|
* 住院发药相关数据访问层
|
|
*
|
|
* 新增:
|
|
* 1. {@code updateDispenseSummaryStatus(Long)}:在发药明细完成后,将对应的发药汇总单状态
|
|
* 更新为 “已完成”。该方法用于解决 Bug #503 中发药明细与发药汇总单状态不同步的问题。
|
|
*
|
|
* 说明:
|
|
* - 发药汇总单表名为 {@code inpatient_dispense_summary},状态字段为 {@code status}。
|
|
* - 状态值 {@code COMPLETED} 与 PRD 中定义保持一致。
|
|
*/
|
|
@Mapper
|
|
public interface DispenseMapper {
|
|
|
|
/** 发药汇总单已完成状态(与 PRD 保持一致) */
|
|
String SUMMARY_STATUS_COMPLETED = "COMPLETED";
|
|
|
|
/**
|
|
* 将对应住院订单的发药汇总单状态更新为已完成。
|
|
*
|
|
* @param orderId 住院医嘱主键
|
|
* @return 更新记录数,通常为 1
|
|
*/
|
|
@Update({
|
|
"<script>",
|
|
"UPDATE inpatient_dispense_summary",
|
|
"SET status = #{status}",
|
|
"WHERE order_id = #{orderId}",
|
|
"</script>"
|
|
})
|
|
int updateDispenseSummaryStatus(@Param("orderId") Long orderId,
|
|
@Param("status") String status);
|
|
}
|