package com.qmth.teachcloud.report.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qmth.teachcloud.report.business.bean.result.*;
import com.qmth.teachcloud.report.business.entity.TBExamStudent;
import org.apache.ibatis.annotations.Param;

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

/**
 * <p>
 * 考生表 Mapper 接口
 * </p>
 *
 * @author wangliang
 * @since 2021-06-01
 */
public interface TBExamStudentMapper extends BaseMapper<TBExamStudent> {

    /**
     * 查询开课学院列表
     *
     * @param schoolId
     * @param examId
     * @param courseCode
     * @param absent
     * @param current
     * @param status
     * @return
     */
    List<TBExamStudentResult> selectTeachCollegeList(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("absent") Boolean absent, @Param("current") Boolean current, @Param("status") String status);

    /**
     * 查询考查学院列表
     *
     * @param schoolId
     * @param examId
     * @param courseCode
     * @param absent
     * @param current
     * @param status
     * @return
     */
    List<TBExamStudentResult> selectInspectCollegeList(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("absent") Boolean absent, @Param("current") Boolean current, @Param("status") String status);

    /**
     * 查询考查学院列表(任课老师)
     *
     * @param schoolId
     * @param examId
     * @param courseCode
     * @param absent
     * @param current
     * @param status
     * @return
     */
    List<TBExamStudentResult> selectInspectCollegeListByTeacher(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("collegeIds") List<Long> collegeIds, @Param("teacherId") Long teacherId, @Param("absent") Boolean absent, @Param("current") Boolean current, @Param("status") String status);

    /**
     * 查询老师列表
     *
     * @param schoolId
     * @param examId
     * @param courseCode
     * @param inspectCollegeId
     * @param teachCollegeId
     * @param absent
     * @param current
     * @param status
     * @return
     */
    List<TBExamStudentResult> selectTeachList(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("inspectCollegeId") Long inspectCollegeId, @Param("teachCollegeId") Long teachCollegeId, @Param("absent") Boolean absent, @Param("current") Boolean current, @Param("status") String status);

    /**
     * 查询班级列表
     *
     * @param schoolId
     * @param examId
     * @param courseCode
     * @param inspectCollegeIdList
     * @param teacherId
     * @param absent
     * @param current
     * @param status
     * @return
     */
    List<TBExamStudentResult> selectClassList(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("teacherId") Long teacherId, @Param("courseCode") String courseCode, @Param("inspectCollegeIdList") List<Long> inspectCollegeIdList, @Param("absent") Boolean absent, @Param("current") Boolean current, @Param("status") String status);

    /**
     * 开课成绩查询
     *
     * @param page
     * @param schoolId
     * @param semesterId
     * @param examId
     * @param courseCode
     * @param current
     * @param inspectCollegeId
     * @param teacherId
     * @param studentParam
     * @param collegeIds
     * @return
     */
    IPage<TeachCollegeResult> listTeachCollegeResult(@Param("page") Page<TeachCollegeResult> page, @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("current") Boolean current, @Param("inspectCollegeId") Long inspectCollegeId, @Param("teachCollegeId") Long teachCollegeId, @Param("teacherId") Long teacherId, @Param("studentParam") String studentParam, @Param("collegeIds") List<Long> collegeIds, @Param("column") String column, @Param("order") String order);

    List<TeachCollegeResult> listTeachCollegeResult(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("current") Boolean current, @Param("inspectCollegeId") Long inspectCollegeId, @Param("teacherId") Long teacherId, @Param("studentParam") String studentParam, @Param("collegeIds") List<Long> collegeIds, @Param("column") String column, @Param("order") String order);

    /**
     * 考查成绩查询
     *
     * @param page
     * @param schoolId
     * @param semesterId
     * @param examId
     * @param courseCode
     * @param current
     * @param inspectCollegeId
     * @param teacherId
     * @param studentParam
     * @return
     */
    IPage<InspectCollegeResult> listInspectCollegeResult(@Param("page") Page<InspectCollegeResult> page, @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("current") Boolean current, @Param("inspectCollegeId") Long inspectCollegeId, @Param("teacherId") Long teacherId, @Param("clazzId") Long clazzId, @Param("studentParam") String studentParam, @Param("column") String column, @Param("order") String order);

    List<InspectCollegeResult> listInspectCollegeResult(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("current") Boolean current, @Param("inspectCollegeId") Long inspectCollegeId, @Param("teacherId") Long teacherId, @Param("clazzId") Long clazzId, @Param("studentParam") String studentParam, @Param("column") String column, @Param("order") String order);

    /**
     * 学生报告预览-列表接口
     *
     * @param iPage
     * @param schoolId
     * @param examId
     * @param collegeId
     * @param courseCode
     * @param clazzId
     * @param absent
     * @return
     */
    IPage<TBStudentReportResult> reportList(IPage<Map> iPage, @Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("collegeId") Long collegeId, @Param("courseCode") String courseCode, @Param("clazzId") Long clazzId, @Param("absent") Boolean absent, @Param("studentCode") String studentCode);

    List<ExamInfo> listExamBySchoolIdAndStudentCode(@Param("schoolId") Long schoolId, @Param("studentCode") String studentCode);

    List<CourseInfo> listCourseByExamIdAndStudentCode(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("studentCode") String studentCode);
}
