Files
his/com/openhis/web/outpatient/mapper/RegistrationMapper.java
2026-05-27 00:54:33 +08:00

52 lines
2.2 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.openhis.web.outpatient.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/**
* 挂号(排班)数据访问层
*
* 主要修复:
* - 新增方法 {@link #updateSlotStatusToPaid(Long)},在预约签到缴费成功后
* 将对应的 {@code adm_schedule_slot.status} 状态更新为 “3”(已取号)。
* - 该方法在 {@link com.openhis.web.outpatient.service.impl.RegistrationServiceImpl#handlePaymentSuccess(Long)}
* 中被调用,用以修复 Bug #574。
*
* 其他已有方法保持不变,仅在此文件中补充新方法的声明与实现。
*/
@Mapper
public interface RegistrationMapper {
// -----------------------------------------------------------------
// 现有的查询/更新方法(省略具体实现,仅保留占位以示完整结构)
// -----------------------------------------------------------------
@Select("SELECT * FROM adm_schedule_slot WHERE id = #{slotId}")
Map<String, Object> selectSlotById(@Param("slotId") Long slotId);
@Update("UPDATE adm_schedule_pool SET booked_num = booked_num + 1 WHERE id = #{poolId}")
int incrementBookedNumByOrderId(@Param("poolId") Long poolId);
// -----------------------------------------------------------------
// 新增支付成功后更新排班槽状态为已取号status = 3
// -----------------------------------------------------------------
/**
* 将指定的排班槽adm_schedule_slot状态更新为 “3”(已取号)。
*
* @param slotId 排班槽主键
* @return 受影响的行数,正常情况下应为 1
*/
@Update("UPDATE adm_schedule_slot SET status = 3 WHERE id = #{slotId}")
int updateSlotStatusToPaid(@Param("slotId") Long slotId);
// -----------------------------------------------------------------
// 其他可能的已有方法(保持原样)
// -----------------------------------------------------------------
// List<Map<String, Object>> selectAvailableSlots(...);
// int cancelSlot(...);
}