package com.xhkjedu.sexam.mapper.paperstudent;

import com.xhkjedu.base.TkMapper;
import com.xhkjedu.sexam.model.paperstudent.EScanerror;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

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

@Repository
public interface EScanerrorMapper extends TkMapper<EScanerror> {
    //试卷扫描出错列表
    List<EScanerror> listByBatchIds(@Param("batchids") String batchids);

    //批量标记待处理的扫描异常为已处理缺考异常
    void batchHandleQkError(@Param("list") List<EScanerror> list);

    //更新状态
    void updateErrorState(@Param("serrorid") Integer serrorid, @Param("errorstate") Integer errorstate);

    //获取考号重复扫描出错记录id
    List<Integer> listIdByExamNo(@Param("examno") String examno,@Param("epid")Integer epid);

    //获取扫描操作各类型未处理数量
    List<Map> listBatchErrorNum(@Param("epid")Integer epid);

    //根据试卷id和错误类型获取扫描错误信息
    List<EScanerror> listErrorsByErrortype(@Param("epid")Integer epid,@Param("errortype")Integer errortype);

    //根据批次名称获取扫描出错数量
    Integer getErrNumByBatchName(@Param("batchname") String batchname);

    //根据试卷id和学生考号获取出错数量
    Integer getErrorNumByExamno(@Param("epid") Integer epid, @Param("examno") String examno);

    //修改stupic地址
    void updateErrorStupic(@Param("serrorid") Integer serrorid, @Param("stupic") String stupic);

    //根据serrorid获取errorjson数据
    EScanerror getErrorJsonById(@Param("serrorid") Integer serrorid);

    List<EScanerror> listErrorObjByIds(@Param("serrorids") List<Integer> serrorids);

    //修改扫描出错状态和考号
    void updateErrorStateExamno(@Param("serrorid") Integer serrorid, @Param("errorstate") int errorstate,
                                @Param("examno") String examno);
}
