package com.xhkjedu.sexam.mapper.exam;

import com.xhkjedu.base.TkMapper;
import com.xhkjedu.sexam.model.exam.ESubject;
import org.apache.ibatis.annotations.Param;

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

public interface ESubjectMapper extends TkMapper<ESubject> {
    //考试设置
    void setExam(@Param("subjects") List<ESubject> subjects, @Param("handleid") Integer handleid
            ,@Param("timestamp") int timestamp);

    //更新考试科目状态
    void updateExamSubjectState(@Param("esstate") Integer esstate, @Param("esid") Integer esid);

    //根据试卷id更新考试科目状态
    void updateEsubjectStateByEpid(@Param("esstate") Integer esstate, @Param("epid") Integer epid);

    //考试科目列表
    List<Map> listSubject(@Param("examid") Integer examid);

    //根据考试科目id获取考试id
    Integer getExamIdByEsId(@Param("esid") Integer esid);

    //考试科目设置列表
    List<Map> listSubjectSet(@Param("examid") Integer examid);

    //考试科目阅卷设置列表
    List<Map> listSubjectCSet(@Param("examid") Integer examid);

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

    //获取未完成的考试试卷数量
    Integer countNoCompletePaper(@Param("examid") Integer examid);

    //获取考试关联科目及科目下试题数量
    List<Map> listSubjectAndPnum(@Param("examid") Integer examid);

    //考试科目选择列表
    List<Map> listSubjectForSel(Integer examid);

    //试卷开始考试
    void startPaper(@Param("strtime") String strtime);

    //试卷结束考试
    void endPaper(@Param("timestamp") int timestamp, @Param("strtime") String strtime);

    //获取考试科目状态
    Integer getPstateByExamIdSid(@Param("examid") Integer examid,@Param("subjectid") String subjectid);

    //修改考试科目试卷状态
    void updatePstate(@Param("examid") Integer examid);
}