package com.xhkjedu.sexam.mapper.exam;

import com.xhkjedu.base.TkMapper;
import com.xhkjedu.sexam.model.exam.EBase;
import com.xhkjedu.sexam.vo.exam.EBaseVo;
import org.apache.ibatis.annotations.Param;

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

public interface EBaseMapper extends TkMapper<EBase> {
    //考试删除
    Integer deleteById(@Param("examid") Integer examid);

    //删除关联的班级
    void deleteClassById(@Param("examid") Integer examid);

    //考试列表
    List<Map> listAll(@Param("base") EBase base);

    //修改考试状态
    void updateExamState(@Param("examid") Integer examid, @Param("examstate") int examstate);

    //结束考试更改状态和报告状态
    void updateExamStateAndReportState(@Param("examid") Integer examid, @Param("examstate") int examstate);
    //修改报告pdf后
    void updateExamReportSchoolState(@Param("examid") Integer examid, @Param("reportstate") int reportstate,@Param("reportschool")String reportschool);
    //更改pdf报告生成状态
    void updateExamReportState(@Param("examid") Integer examid, @Param("reportstate") int reportstate);

    //考试基本信息
    Map findById(@Param("examid") Integer examid);

    //考试基本信息(带考试人数)
    Map findById2(@Param("examid") Integer examid);

    //根据考试id获取名称
    String getNameByExamId(@Param("examid") Integer examid);

    //发布考试
    void postExam(@Param("examid") Integer examid, @Param("examcomm") String examcomm);

    //根据考试id获取考试状态信息
    EBaseVo getExamStateById(@Param("examid") Integer examid);

    //考试设置状态
    Map getSetState(@Param("examid") Integer examid);

    //根据考试id获取考试状态
    Integer getExamState(@Param("examid") Integer examid);

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

    //获取考试状态和是否设置答案
    EBaseVo getExamStateAnseredById(Integer examid);

    //考试未批阅试题数量
    Integer getNoCheckNum(@Param("examid") Integer examid);

    //根据考试id获取状态和模式
    EBaseVo getExamStateAndMode(@Param("examid") Integer examid);

    //根据考试id获取显示排名
    EBase getShowRankById(@Param("examid") Integer examid);

    //根据考试id获取pdf报告状态
    Integer getReportState(@Param("examid") Integer examid);

    //根据考试id获取pdf报告状态和校级报告地址
    Map getReportSchool(@Param("examid") Integer examid);

    //清空考试报告
    void clearExamPdf(@Param("examid") Integer examid);

    //获取学校当前年份
    Integer getYearByUserid(@Param("userid") Integer userid);

    //获取考试学校id
    Integer getSchoolidByExamid(@Param("examid") Integer examid);

    //获取0分学生是否参与统计
    Integer getStuZeroByExamId(@Param("examid") Integer examid);
}