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

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qmth.distributed.print.business.bean.dto.ExamStudentCourseDto;
import com.qmth.distributed.print.business.bean.dto.ExamStudentPdfInfoDto;
import com.qmth.distributed.print.business.bean.dto.SyncExamStudentDto;
import com.qmth.distributed.print.business.entity.ExamStudent;
import com.qmth.teachcloud.common.entity.SysOrg;
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> {

    Map<String, Object> getStudentDetail(Long id);

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

    List<SyncExamStudentDto> listStudentByPrintPlanIdAndSyncStatus(Long printPlanId);

    void insertBatch(@Param("examStudents") List<ExamStudent> examStudents);

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

    SysOrg getSysOrgByBelongOrgId(@Param("studentCode") String studentCode, @Param("schoolId") Long schoolId);

    ExamStudentPdfInfoDto getByStudentId(Long id);

    List<Map> listStudentScoreSync(@Param("schoolId") Long schoolId, @Param("studentCode") String studentCode, @Param("examNumber") String examNumber, @Param("subjectCode") String subjectCode, @Param("printPlanId") Long printPlanId);

    List<ExamStudentCourseDto> listExamStudentByPaperNumberAndPaperType(@Param("paperNumber") String paperNumber, @Param("paperType") String paperType);
}
