package com.jd.lightapplication.mapper;

import com.jd.lightapplication.model.MeetingInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface MeetingInfoMapper extends BaseMapper<MeetingInfo> {

    @Select("SELECT * FROM meeting_info WHERE reception_time > NOW() ORDER BY reception_time limit 0,1")
    MeetingInfo getNextMeeting();

    @Update("UPDATE meeting_info SET status = #{status} WHERE id = #{meetingId}")
    Integer updateStatus(@Param("meetingId") Long meetingId, @Param("status") Integer status);
}
