package com.qmth.distributed.print.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qmth.distributed.print.business.bean.dto.ExamStudentCourseClassDto;
import com.qmth.distributed.print.business.bean.dto.ExamStudentCourseDto;
import com.qmth.distributed.print.business.bean.dto.ExamStudentDto;
import com.qmth.distributed.print.business.bean.dto.ExamStudentPdfInfoDto;
import com.qmth.distributed.print.business.entity.ExamStudent;
import org.apache.ibatis.annotations.Param;

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

/**
 * <p>
 * 考生 Mapper 接口
 * </p>
 *
 * @author xf
 * @since 2021-03-23
 */
public interface ExamStudentMapper extends BaseMapper<ExamStudent> {

    @SuppressWarnings("MybatisXMapperMethodInspection")
    Map<String, Object> getStudentDetail(Long id);

    /**
     * 根据科目查询考生
     *
     * @param schoolId
     * @param examDetailCourseIds
     * @return
     */
    List<ExamStudentCourseDto> queryBySchoolIdAndExamDetailCourseIds(@Param("schoolId") Long schoolId, @Param("examDetailCourseIds") List<Long> examDetailCourseIds);

    /**
     * 根据班级id查询考生，班级可以是教学班或行政班（两表查）
     *
     * @param schoolId 学校id
     * @param classId  班级id
     * @return 考生查询结果
     */
    List<ExamStudent> listExamStudentBySchoolIdAndClazzId(@Param("schoolId") Long schoolId, @Param("classId") String classId);

    ExamStudentPdfInfoDto getByStudentId(Long id);

    @SuppressWarnings("MybatisXMapperMethodInspection")
    List<ExamStudentCourseClassDto> listExamStudentByPaperNumberAndPaperType(@Param("batchId") Long batchId, @Param("examId") Long examId, @Param("paperNumber") String paperNumber,
                                                                             @Param("paperType") String paperType);

    List<String> listUserClass(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("paperNumber") String paperNumber);

    ExamStudent listByExamDetailCourseIdLimit1(@Param("schoolId") Long schoolId, @Param("examDetailCourseId") Long examDetailCourseId);

    List<ExamStudent> listByExamDetailCourseIdNotIntMarkStudent(@Param("examDetailCourseId") Long examDetailCourseId, @Param("paperType") String paperType);

    /**
     * 查询班级和老师信息
     *
     * @param examId
     * @param courseCode
     * @param paperNumber
     * @return
     */
    ExamStudentDto queryExamStudent(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber);
}
