新增校验,防止删除存在有效患者预约的医生排班。
更新 SurgeryDto,为计划手术时间添加 JSON 格式配置。 改进接诊确认逻辑,使医师确认流程更加健壮。 在 OrderMapper 中新增方法,用于统计患者在指定时间段内的有效预约订单数量。 增强 TicketServiceImpl,防止同一患者在相同科室与时间段内重复预约。
This commit is contained in:
@@ -217,6 +217,23 @@
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="countPatientDeptOrdersInPeriod" resultType="int">
|
||||
select count(*)
|
||||
from order_main
|
||||
<where>
|
||||
and patient_id = #{patientId}
|
||||
and department_id = #{departmentId}
|
||||
and appointment_time >= #{startTime}
|
||||
and appointment_time < #{endTime}
|
||||
<if test="statuses != null and statuses.size() > 0">
|
||||
and status in
|
||||
<foreach item="s" collection="statuses" open="(" separator="," close=")">
|
||||
#{s}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="updateOrderStatusById">
|
||||
update order_main set status = #{status} where id = #{id}
|
||||
</update>
|
||||
|
||||
Reference in New Issue
Block a user