package com.keao.edu.user.dao;


import com.keao.edu.common.dal.BaseDAO;
import com.keao.edu.user.api.entity.ExamRoom;
import com.keao.edu.user.dto.ExamRoomDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface ExamRoomDao extends BaseDAO<Long, ExamRoom> {

    int batchInsert(@Param("examRooms") List<ExamRoom> examRooms);

    /**
     * COUNT教师考试列表
     * @param params
     * @return
     */
    int countExamRoomPage(Map<String, Object> params);

    /**
     * 获取教师考试列表（未完待续）
     * @param params
     * @return
     */
    List<ExamRoomDto> queryExamRoomPage(Map<String, Object> params);

    /**
     * @describe 删除指定教室
     * @author Joburgess
     * @date 2020.06.24
     * @param examRoomIds:
     * @return int
     */
    int batchDeleteExamRooms(@Param("examRoomIds") List<Long> examRoomIds);
    
    /**
     * @describe 获取指定考级项目下的考场
     * @author Joburgess
     * @date 2020.06.30
     * @param examId: 
     * @return java.util.List<com.keao.edu.user.api.entity.ExamRoom>
     */
    List<ExamRoom> getWithExam(@Param("organIds") List<Integer> organIds,
                                @Param("examId") Integer examId);

    int updateSL(ExamRoom examRoom);

    ExamRoom lockRoom(@Param("examRoomId") Long examRoomId);
}
