package com.xhkjedu.smarking.mapper.papercheck;

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

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

/**
 * @Description 阅卷试卷阅卷方式表 Mapper 接口
 * @Author auto
 * @Date 2024-10-15
 */
public interface MsPaperCheckMapper extends TkMapper<MsPaperCheck> {
    //根据题块id获取阅卷方式id
    Integer getMpcIdByMBlockId(@Param("mpid") Integer mpid, @Param("mblockid") Integer mblockid);

    //阅卷分配-按题块列表（线下）
    List<Map> listPaperCheck(@Param("mpid") Integer mpid);

    //获取试卷分配总数
    Map getDispenseNum(@Param("mpid") Integer mpid, @Param("mblockid") Integer mblockid,@Param("correcttype") Integer correcttype);

    //获取题块分配教师列表
    List<MsPaperCheckTeacher> listTeacherByMBlockId(@Param("mpid") Integer mpid,@Param("mblockid") Integer mblockid);

    //根据题块id获取阅卷信息
    MsPaperCheck findByMBlockId(@Param("mpid") Integer mpid,@Param("mblockid") Integer mblockid);

    //获取学生作答及批阅信息
    List<MsPaperCheckVo> listStudentByMBlockId(@Param("mblockid") Integer mblockid,@Param("numtype") Integer numtype);
    List<MsPaperCheckVo> listStudentByMpsqId(@Param("mblockid") Integer mblockid,@Param("numtype") Integer numtype);

    //更新题块阅卷状态
    void updateCheckStateByMsId(@Param("msid") Integer msid,@Param("checkstate") int checkstate);

    //阅卷分配-按班级列表（线上）
    List<Map> listSubjectClass(@Param("mpid") Integer mpid);

    //阅卷分配-按试题列表（线上）
    List<Map> listQuestion(@Param("mpid") Integer mpid);

    //获取需要批阅的数量
    Integer getNeedCheckNum(@Param("mblockid") Integer mblockid,@Param("correcttype") Integer correcttype);

    //根据mpid和mblockids删除阅卷方式
    void deleteByMpIdAndBlockIds(@Param("mpid") Integer mpid,@Param("mblockids") List<Integer> mblockids);

    //获取阅卷设置状态
    Integer getCheckSetById(@Param("mpcid") Integer mpcid);
}
