| | |
| | | @Update("UPDATE guide_receiving_session SET status = 'IN_SERVICE', updated_at = NOW() " + |
| | | "WHERE id = #{id} AND deleted = 0 AND status = 'RECEIVING' AND service_start_at <= NOW()") |
| | | int startDueSession(Long id); |
| | | |
| | | @Update("UPDATE guide_receiving_session SET reminder_pushed_at = #{now}, updated_at = NOW() " + |
| | | "WHERE id = #{id} AND deleted = 0 AND status = 'RECEIVING' AND reminder_pushed_at IS NULL") |
| | | int claimServiceReminder(@Param("id") Long id, @Param("now") LocalDateTime now); |
| | | |
| | | @Update("UPDATE guide_receiving_session SET reminder_pushed_at = NULL, updated_at = NOW() " + |
| | | "WHERE id = #{id} AND deleted = 0 AND reminder_pushed_at = #{claimedAt}") |
| | | int releaseServiceReminder(@Param("id") Long id, @Param("claimedAt") LocalDateTime claimedAt); |
| | | |
| | | @Update("UPDATE guide_receiving_session SET status = 'STOPPED', updated_at = NOW() " + |
| | | "WHERE guide_id = #{guideId} AND deleted = 0 AND status = 'RECEIVING'") |
| | | int stopReceivingByGuide(Long guideId); |
| | | } |