| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.tcm.training.admin.live.entity.LiveSession; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Update; |
| | | |
| | | @Mapper |
| | | public interface LiveSessionMapper extends BaseMapper<LiveSession> { |
| | | } |
| | | |
| | | /** |
| | | * 仅当场次仍处于未开始状态时,将其切换为直播中,保证人工开播与自动开播幂等。 |
| | | */ |
| | | @Update("UPDATE tcm_live_session " + |
| | | "SET live_status = 1, " + |
| | | "actual_start_time = CASE WHEN actual_start_time IS NULL THEN #{actualStartTime} ELSE actual_start_time END, " + |
| | | "updated_at = NOW() " + |
| | | "WHERE id = #{sessionId} AND deleted = 0 AND live_status = 0") |
| | | int markLivingIfPending(@Param("sessionId") Long sessionId, @Param("actualStartTime") java.time.LocalDateTime actualStartTime); |
| | | } |