package com.xhkjedu.smarking.mapper.paper;

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

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


/**
 * @Description 阅卷试卷表 Mapper 接口
 * @Author auto
 * @Date 2024-10-15
 */
public interface MsPaperMapper extends TkMapper<MsPaper> {

    //设置试卷中试题数量
    int updatePaperInfo(@Param("paper") MsPaper paper);

    //更新试卷答案设置状态
    int updatePaperAnswer(@Param("answered") Integer answered,@Param("mpid") Integer mpid);

    //获取试卷详情
    Map<String,Object> getPaperInfoByMsid(@Param("msid") Integer msid);

    //获取考试科目对应考试状态信息
    PExamSubjectVo getExamSubjectForPaper(@Param("mpid")Integer mpid);

    //删除试卷对应模板、题块、批阅设置
    int deleteTemplageBlockByMpid(@Param("mpid") Integer mpid);

    //获取考试试卷题量和分值
    List<MsPaper> listNumAndScoreByExamId(@Param("examid") Integer examid);

    //教师出卷列表
    List<Map<String,Object>> listExamPapersByTeacherid(@Param("teacherid") Integer teacherid, @Param("pstate") Integer pstate
            ,@Param("strtime") String strtime);

    //根据试卷id获取考试状态
    Integer getExamStateByMpid(@Param("mpid") Integer mpid);


    //获取试卷ID及考试模式
    PExamSubjectVo getPaperAndMxammodeByMpid(@Param("mpid") Integer mpid);

    //根据考试id和科目id获取试卷信息
    MsPaper getPaperByExamIdAndSubjectId(@Param("examId") Integer examId, @Param("subjectId") String subjectId);

    //根据试卷ID获取考试ID
    Integer getExamidByMpid(@Param("mpid") Integer mpid);

    //根据考试科目ID获取试卷ID
    Integer getMpIdByMsId(@Param("msid") Integer msid);

    //修改题块设置后试卷中试题数量
    Integer updaePaperMeregpnumByMpid(@Param("mpid") Integer mpid, @Param("mergepnum") Integer mergepnum);

    //获取试卷对应科目状态
    PExamSubjectVo getSubjectStateByMpid(@Param("mpid") Integer mpid);

    //获取试卷批阅设置
    Integer getCorrectTypeByMpId(@Param("mpid") Integer mpid);

    //获取试卷类型
    Integer getPaperTypeByMpsid(@Param("mpsid") Integer mpsid);
    //修改试卷切割状态
    int updatePaperCutState(@Param("mpid") Integer mpid, @Param("cutstate") Integer cutstate);
    //获取试卷切割状态
    Integer getPaperCutStateByMpid(@Param("mpid") Integer mpid);
    //根据试卷ID获取科目名称和考试名称
    Map<String,Object> getSubjectAndExamByMpid(@Param("mpid") Integer mpid);
}
