package com.keao.edu.user.dao;


import com.keao.edu.common.dal.BaseDAO;
import com.keao.edu.user.dto.ExamRegistrationStatisticsDto;
import com.keao.edu.user.entity.ExamRegistration;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ExamRegistrationDao extends BaseDAO<Long, ExamRegistration> {

    /**
     * @describe 统计无教室学员
     * @author Joburgess
     * @date 2020.06.29
     * @param organIds:
     * @return int
     */
    int countWithoutExamRoomStudentNum(@Param("organIds")List<Integer> organIds,
                                       @Param("examId") Integer examId);

    /**
     * @describe 统计已分配教室学员数量
     * @author Joburgess
     * @date 2020.06.30
     * @param organIds:
     * @param examId:
     * @return int
     */
    int countInExamRoomStudentNum(@Param("organIds")List<Integer> organIds,
                                  @Param("examId") Integer examId);

    /**
     * @describe 统计总报名人数
     * @author Joburgess
     * @date 2020.06.30
     * @param organIds:
     * @param examId:
     * @return int
     */
    int countTotalRegistrationStudentNumWithExam(@Param("organIds")List<Integer> organIds,
                                                 @Param("examId") Integer examId);

    /**
     * @describe 统计招生信息
     * @author Joburgess
     * @date 2020.06.30
     * @param selfOrganId: 本级合作单位编号
     * @param organIds: 本级及子级合作单位编号
     * @param examId: 考级项目编号
     * @return com.keao.edu.user.dto.ExamRegistrationStatisticsDto
     */
    ExamRegistrationStatisticsDto getExamRegistrationStaticsInfo(@Param("selfOrganId") Integer selfOrganId,
                                                                 @Param("organIds") List<Integer> organIds,
                                                                 @Param("examId") Integer examId);

    /**
     * @describe 获取指定考级项目下指定学员的报名记录
     * @author Joburgess
     * @date 2020.07.02
     * @param examId:
     * @param studentIds:
     * @return java.util.List<com.keao.edu.user.entity.ExamRegistration>
     */
    List<ExamRegistration> getWithExamAndStudents(@Param("examId") Integer examId,
                                                  @Param("studentIds") List<Integer> studentIds);

}
