package com.xhkjedu.smarking.mapper.exam;

import com.xhkjedu.base.TkMapper;
import com.xhkjedu.smarking.model.exam.MsSubject;
import com.xhkjedu.smarking.model.paper.MsPaper;
import org.apache.ibatis.annotations.Param;

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

/**
 * @Description 阅卷考试科目表 Mapper 接口
 * @Author auto
 * @Date 2024-10-15
 */
public interface MsSubjectMapper extends TkMapper<MsSubject> {
    //考试进度总览
    List<Map<String, Object>> examOverview(@Param("examid")Integer examid);
    //考试进度总览-批阅仲裁疑难数量-线上
    List<Map<String, Object>> examOverviewProblemForOnline(@Param("examid")Integer examid);
    //考试进度总览-批阅仲裁疑难数量-线下
    List<Map<String, Object>> examOverviewProblemForOffline(@Param("examid")Integer examid);

    //设置考试时间
    void setExamDate(@Param("subjects") List<MsSubject> subjects, @Param("handleid") Integer handleid, @Param("timestamp") int timestamp);

    //更改科目试卷设置状态
    int updatePstateByMpid(@Param("mpid")Integer mpid,@Param("pstate")Integer pstate);

    //根据考试科目id获取考试科目基本信息
    Map getESubjectByMsId(@Param("msid")Integer msid);

    //获取考试下学科组长权限科目
    Map<String,Object> getExamLeadSubjects(@Param("msid")Integer msid,@Param("leaderid")Integer leaderid);

    //更改科目试卷模板设置状态
    int updatePtstateByMpid(@Param("mpid")Integer mpid,@Param("ptstate")Integer ptstate);
    //更改科目试卷题块设置状
    int updatePbstateByMpid(@Param("mpid")Integer mpid,@Param("pbstate")Integer pbstate);

    //获取考试下所有科目名称
    List<Map<String,String>> listSubjectNameByExamId(@Param("examid") Integer examid);

    //根据考试科目id获取阅卷状态
    Integer getCheckStateByMsId(@Param("msid") Integer msid);

    //更改考试科目监考设置状态
    void updateInvigilateStateByMsId(@Param("msid") Integer msid,@Param("invigilatestate") int invigilatestate);

    //更改考试科目阅卷设置状态
    void updateCheckSetByMsId(@Param("msid") Integer msid, @Param("checkset") Integer checkset,@Param("correcttype") Integer correcttype);
    //更改阅卷设置状态
    void updateCheckSetByMpId(@Param("mpid") Integer mpid, @Param("checkset") Integer checkset);

    //试监控-考试基本信息
    Map<String,Object> getExamSubjectByMsid(@Param("msid") Integer msid);
    //定时任务-科目开始考试
    int updateStartSubject(@Param("strtime") String strtime);
    //定时任务-科目结束考试-获取待结束考试
    List<Integer> listMsidsForEndSubject(@Param("strtime") String strtime);
    //定时任务-科目对应考试下所有科目
    List<MsSubject> listSubjectAndStateByMsids(@Param("list") List<Integer> list);
    //定时任务-科目结束考试
    int updateEndSubject(@Param("timestamp") Integer timestamp,@Param("msids")List<Integer> msids);

    //获取考试科目ids
    List<String> listSubjectIdsByExamId(@Param("examid") Integer examid);

    //获取考试科目信息
    List<Map<String,Object>> listByExamId(@Param("examid") Integer examid);

    //修改试卷结构后更改后续操作状态
    int updatePaperFollowup(@Param("mpid")Integer mpid);

    //单科设置信息
    Map getSet(@Param("examid") Integer examid, @Param("subjectid") String subjectid
            ,@Param("exammode") Integer exammode,@Param("monitored") Integer monitored);

    //考试报告科目列表
    List<MsPaper> listReportSubject(@Param("examid") Integer examid, @Param("exammode") Integer exammode);
}
