package com.qmth.teachcloud.mark.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

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.common.bean.dto.DataPermissionRule;
import com.qmth.teachcloud.common.bean.dto.mark.MarkSettingDto;
import com.qmth.teachcloud.mark.bean.archivescore.ArchiveScoreQuery;
import com.qmth.teachcloud.mark.bean.archivescore.ArchiveScoreVo;
import com.qmth.teachcloud.mark.bean.document.ArchivePaperQuery;
import com.qmth.teachcloud.mark.bean.document.ArchivePaperVo;
import com.qmth.teachcloud.mark.dto.mark.score.CheckScoreListDto;
import com.qmth.teachcloud.mark.dto.mark.score.MarkPaperPackageDto;
import com.qmth.teachcloud.mark.entity.MarkPaper;

/**
 * <p>
 * 考试科目表 Mapper 接口
 * </p>
 *
 * @author xf
 * @since 2023-09-22
 */
public interface MarkPaperMapper extends BaseMapper<MarkPaper> {

    IPage<MarkSettingDto> listPaperSetting(@Param("page") Page<MarkSettingDto> page, @Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("groupStatus") Boolean groupStatus, @Param("dpr") DataPermissionRule dpr);

    List<MarkPaper> listQualityMarkPaperByStatus(@Param("status") String status, @Param("uploadCount") int uploadCount);

    IPage<CheckScoreListDto> listStudentScoreList(@Param("page") Page<CheckScoreListDto> page, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("dpr") DataPermissionRule dpr);

    IPage<MarkPaperPackageDto> listPackage(@Param("page") Page<MarkPaperPackageDto> page, @Param("examId") Long examId, @Param("coursePaperId") String coursePaperId, @Param("packageCode") String packageCode);

    List<MarkSettingDto> listPaperSetting(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("groupStatus") boolean groupStatus, @Param("dpr") DataPermissionRule dpr);

    IPage<ArchiveScoreVo> scoreList(Page<ArchiveScoreVo> page, @Param("schoolId") Long schoolId, @Param("req") ArchiveScoreQuery query, @Param("dpr") DataPermissionRule dpr);

    int getCourseCount(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("coursePaperId") String coursePaperId, @Param("status") String status, @Param("dpr") DataPermissionRule dpr);

    int getPaperNumberCount(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("coursePaperId") String coursePaperId, @Param("status") String status, @Param("dpr") DataPermissionRule dpr);

    List<MarkPaper> listByExamId(@Param("examId") Long examId, @Param("status") String status, @Param("dpr") DataPermissionRule dpr);

    IPage<ArchivePaperVo> documentList(Page<ArchiveScoreVo> page, @Param("req") ArchivePaperQuery query, @Param("dpr") DataPermissionRule dpr);
}
