package com.xhkjedu.smarking.mapper.papercheck;

import com.xhkjedu.base.TkMapper;
import com.xhkjedu.smarking.model.papercheck.*;
import com.xhkjedu.smarking.vo.papercheck.*;
import org.apache.ibatis.annotations.Param;

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

/**
 * @Description 阅卷批阅教师任务表 Mapper 接口
 * @Author auto
 * @Date 2024-10-15
 */
public interface MsPaperCheckTeacherTaskMapper extends TkMapper<MsPaperCheckTeacherTask> {
    //根据题块ID和教师ID获取指定数量的任务ID列表
    List<Integer> getTaskIdsByMBlockIdAndTeacherId(@Param("mblockid") Integer mblockid,@Param("teacherid") Integer teacherid
            ,@Param("tasknum") Integer tasknum);

    //批量更新任务信息
    void batchUpdate(@Param("tasks") List<MsPaperCheckTeacherTask> tasks);

    //批量保存或更新
    void batchSave(@Param("tasks") List<MsPaperCheckTeacherTask> tasks);

    //保存或更新单个任务
    void save(@Param("s") MsPaperCheckTeacherTask task);

    //阅卷进度-按题块
    List<Map> listByBlock(@Param("mpid") Integer mpid);

    //阅卷进度-按题块-查看详情
    List<Map> detailByBlock(@Param("mpid") Integer mpid, @Param("mblockid") Integer mblockid
            , @Param("dispenseway") Integer dispenseway,@Param("checktype") Integer checktype);

    //阅卷进度-按教师
    List<Map> listByTeacher(@Param("mpid") Integer mpid, @Param("correcttype") Integer correcttype);

    //教师阅卷-待/已阅卷列表
    List<Map> listCorrect(@Param("param") MsCheckParam param);

    //教师阅卷-待阅卷详情
    List<Map> listPendingBlock(@Param("param") MsCheckParam param);

    //教师阅卷-题块列表
    List<Map> listTeacherBlock(@Param("param") MsCheckParam param);

    //教师阅卷-试题列表
    List<Map> listTeacherQuestion(@Param("param") MsCheckParam param);

    //教师阅卷-班级列表
    List<Map> listTeacherClass(@Param("param") MsCheckParam param);

    //教师阅卷-待批题块列表
    List<MsPaperCheck> listBlockCheck(@Param("param") MsCheckParam param);

    //教师阅卷-按题块-获取待批试题
    MsPaperCheckVo getCorrectBlock(@Param("param") MsPaperCheck param);

    //删除教师阅卷任务
    void deleteByMpsbids(@Param("mpsbids") String mpsbids);

    //阅卷进度-按试题
    List<Map> listByQuestion(@Param("mpid") Integer mpid,@Param("correcttype") Integer correcttype);

    //阅卷进度-按试题-查看详情
    List<Map> detailByQuestion(@Param("mpid") Integer mpid,@Param("mblockid") Integer mblockid
            ,@Param("dispenseway") Integer dispenseway,@Param("checktype") Integer checktype);

    //阅卷进度-按班级
    List<Map> listByClass(@Param("mpid") Integer mpid,@Param("subjectid") String subjectid);

    //阅卷进度-按班级-查看详情
    List<Map> detailByClass(@Param("mpid") Integer mpid,@Param("mblockid") Integer mblockid
            ,@Param("dispenseway") Integer dispenseway);

    //教师阅卷-待批试题列表
    List<MsPaperCheck> listQuestionCheck(@Param("param") MsCheckParam param);

    //教师阅卷-按试题-获取待批试题
    MsPaperCheckVo getCorrectQuestion(@Param("param") MsPaperCheck param);

    //教师阅卷-待批班级列表
    List<MsPaperCheck> listClassCheck(@Param("param") MsCheckParam param);

    //教师阅卷-按班级-获取待批试题
    MsPaperCheckVo getCorrectClassQuestion(@Param("param") MsPaperCheck check);

    //更新教师阅卷任务状态
    void updateCheckStatus(@Param("mpid") Integer mpid, @Param("mpsbid") Integer mpsbid
            , @Param("teacherid") Integer teacherid, @Param("checkstate") int checkstate);

    //获取教师批阅数量
    MsPaperCheckTeacher getCheckNum(@Param("param") MsPaperCheck paperCheck);

    //教师批阅-批阅试题
    void correct(@Param("param") MsPaperCheckVo param);

    //教师阅卷-上一份
    Map getPreCorrect(@Param("param") MsCheckParam param);

    //教师阅卷-阅卷历史
    List<Map> listCorrectHistory(@Param("param") MsCheckParam param);

    //教师阅卷-历史详情
    Map detailHistory(@Param("param") MsCheckParam param);

    //教师阅卷-平均分
    Map avgScore(@Param("param") MsCheckParam param);

    //教师阅卷-待批阅数量
    Integer getPendingCorrectNum(@Param("param") MsCheckParam param);

    //教师阅卷-待仲裁数量
    Integer getPendingArbitrateNum(@Param("param") MsCheckParam param);

    //获取批阅结果
    MsCheckVo getCheckResult(@Param("param") MsPaperCheckVo param);
}
