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 com.keao.edu.user.dto.ExamRoomExamTimeDto;
import com.keao.edu.user.dto.ExamRoomListDto;
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);

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

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

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

    /**
     * @describe 获取考级教师列表
     * @author Joburgess
     * @date 2020.07.12
     * @param params:
     * @return java.util.List<com.keao.edu.user.api.entity.ExamRoom>
     */
    List<ExamRoomDto> queryExamRoom(Map<String, Object> params);
    int countExamRoom(Map<String, Object> params);

    /**
     * @describe 获取考场首尾考试时间
     * @author Joburgess
     * @date 2020.07.24
     * @param examId:
     * @return com.keao.edu.user.dto.ExamRoomExamTimeDto
     */
    ExamRoomExamTimeDto getExamRoomExamTime(@Param("examId") Long examId);

    /**
     * @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") Long examId);

    int updateSL(ExamRoom examRoom);

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

    /**
     * @describe 根据日期获取教室
     * @author Joburgess
     * @date 2020.07.07
     * @param days:
     * @return java.util.List<com.keao.edu.user.api.entity.ExamRoom>
     */
    List<ExamRoom> getWithDays(@Param("days") List<String> days);

    /**
     * @describe 根据专业获取指定考级项目下可选择教室
     * @author Joburgess
     * @date 2020.07.08
     * @param examId:
     * @param subjectId:
     * @return java.util.List<com.keao.edu.user.api.entity.ExamRoom>
     */
    List<ExamRoom> getWithExamAndSubject(@Param("examId") Long examId,
                                         @Param("subjectId") Integer subjectId);

    /**
     * @describe 获取当前时间之前未关闭的考场
     * @author Joburgess
     * @date 2020.07.30
     * @return java.util.List<com.keao.edu.user.api.entity.ExamRoom>
     */
    List<ExamRoom> getHistoryOpenExamRoom();
}
