package com.xhkjedu.smarking.mapper.scan;

import com.xhkjedu.base.TkMapper;
import com.xhkjedu.smarking.model.scan.MsScanbatch;
import com.xhkjedu.smarking.model.scan.MsScanbatchPaper;
import com.xhkjedu.smarking.vo.scan.ScanParams;
import com.xhkjedu.smarking.vo.stupaper.PaperStudentWebVo;
import org.apache.ibatis.annotations.Param;

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

/**
 * @Description 批阅扫描试卷表 Mapper 接口
 * @Author auto
 * @Date 2024-10-15
 */
public interface MsScanbatchPaperMapper extends TkMapper<MsScanbatchPaper> {

    //获取批次下所有试卷
    List<MsScanbatchPaper> listPaperByBatchid(@Param("batchid") Integer batchid);

    //查看原卷-试卷信息
    Map<String,Object> getScanPaperByMspid(@Param("mspid") Integer mspid);

    //试卷标记为异常
    Integer updatePaperErrortype(@Param("mspid") Integer mspid, @Param("errortype") Integer errortype);

    //指定试卷和考号下未处理异常数量
    Integer getErrorNumByMpidAndExamno(@Param("mpid") Integer mpid, @Param("examno") String examno);

    //扫描异常-异常数量
    List<MsScanbatch> getScanErrorNum(@Param("mpid") Integer mpid);
    //扫描异常-异常列表
    List<Map<String,Object>> listScanPaperErrors(@Param("p") MsScanbatchPaper p);
    //扫描异常-异常列表-数量
    Map<String,Object> listScanPaperErrorsNum(@Param("mpid") Integer mpid);
    //扫描异常-更改状态
    int updateScanPaperMsstate(@Param("mspid") Integer mspid, @Param("msstate") Integer msstate);
    //扫描异常-更改状态和考号
    int updateScanPaperMsstateAndExamno(@Param("mspid") Integer mspid, @Param("msstate") Integer msstate,@Param("examno") String examno);
    //扫描异常-已删除数量
    int getDeleteScanPaperCount(@Param("mpid") Integer mpid);

    //扫描异常-缺考异常-异常处理
    int updateBatchScanPaperMspstate(@Param("list") List<PaperStudentWebVo> list);
    //获取重新识别数据
    List<MsScanbatchPaper> listScanPapersForReidentify(@Param("param") ScanParams param);
    //删除需要重新识别试卷识别数据
    int deleteScanPaperForReidentify(@Param("param") ScanParams param);
}
