package com.keao.edu.user.dao;


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

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

public interface ExamRegistrationDao extends BaseDAO<Long, ExamRegistration> {

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

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

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

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

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

    /**
     * COUNT学员报考记录
     *
     * @param params
     * @return
     */
    int countStudentList(Map<String, Object> params);

    /**
     * 获取学员报考列表
     *
     * @param params
     * @return
     */
    List<ExamRegistrationDto> queryStudentList(Map<String, Object> params);

    /**
     * 学员考试记录
     *
     * @param params
     * @return
     */
    List<ExamRecordDto> queryExamList(Map<String, Object> params);

    /**
     * @param params
     * @return
     */
    int countExamList(Map<String, Object> params);


    /**
     * 获取报名信息
     *
     * @return
     */
    ExamRegistrationDto getExamRegistration(@Param("examRegistrationId") Long examRegistrationId);

    /**
     * 获取单条报名信息
     * @param id
     * @return
     */
    ExamRegistration getExamRegistrationInfo(@Param("id") Integer id);
}
