package com.qmth.distributed.print.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.distributed.print.business.bean.result.BasicExamStudentResult;
import com.qmth.teachcloud.common.entity.BasicExamStudent;
import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 考生字典表 Mapper 接口
 * </p>
 *
 * @author CaoZixuan
 * @since 2024-02-22
 */
public interface BasicExamStudentMapper extends BaseMapper<BasicExamStudent> {

    /**
     * 分页查询
     *
     * @param schoolId        学校id
     * @param semesterId      学期id
     * @param examId          考试id
     * @param courseCode      课程代码
     * @param teacher         教师
     * @param college         学院
     * @param major           专业
     * @param teachClazz      教学班
     * @param examStudentInfo 考生信息（姓名/学号）
     * @param dpr             数据权限
     * @return 查询结果
     */
    IPage<BasicExamStudentResult> findBasicExamStudentPage(@Param("iPage") Page<BasicExamStudentResult> iPage,
            @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId,
            @Param("courseCode") String courseCode, @Param("teacher") String teacher, @Param("college") String college,
            @Param("major") String major, @Param("teachClazz") String teachClazz,
            @Param("examStudentInfo") String examStudentInfo, @Param("dpr") DataPermissionRule dpr);

    /**
     * 列表查询
     *
     * @param schoolId        学校id
     * @param semesterId      学期id
     * @param examId          考试id
     * @param courseCode      课程代码
     * @param teacher         教师
     * @param college         学院
     * @param major           专业
     * @param teachClazz      教学班
     * @param examStudentInfo 考生信息（姓名/学号）
     * @param dpr             数据权限
     * @return 查询结果
     */
    List<BasicExamStudentResult> findBasicExamStudentList(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId,
            @Param("courseCode") String courseCode, @Param("teacher") String teacher, @Param("college") String college,
            @Param("major") String major, @Param("teachClazz") String teachClazz, @Param("examStudentInfo") String examStudentInfo,
            @Param("dpr") DataPermissionRule dpr);

    /**
     * 查询被绑定的考生字典
     *
     * @param idList 考生字典id集合
     * @return 被绑定的考生字典
     */
    List<String> findBoundBasicExamStudentNames(@Param("idList") List<Long> idList);
}
