package com.xhkjedu.smarking.mapper.paper;

import com.xhkjedu.base.TkMapper;
import com.xhkjedu.smarking.model.paper.MsPaperQtype;
import com.xhkjedu.smarking.vo.paper.MsPaperParams;
import com.xhkjedu.smarking.vo.paper.MsPaperQtypeVo;
import org.apache.ibatis.annotations.Param;

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

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

    //根据试卷ID删除试卷结构
    int deleteByMpId(@Param("mpId")Integer mpid);

    //题库试题详情
    List<MsPaperQtypeVo> listPaperQtypeQuestions(@Param("mpid") Integer mpid);

    //附件试题详情
    List<MsPaperQtypeVo> listPaperQtypeQuesitonsForFj(@Param("mpid") Integer mpid);

    //试卷主观题-附件
    List<Map<String,Object>> listSubjectiveQuestionsFj(@Param("mpid") Integer mpid,@Param("qtype")Integer qtype);
    //试卷主观题-题库
    List<Map<String,Object>> listSubjectiveQuestionsTk(@Param("mpid") Integer mpid,@Param("qtype")Integer qtype);
    //修改题型分，修改试卷分
    int updateQtypeScore(@Param("mptid") Integer mptid,@Param("mpid") Integer mpid);
    //修改题型分和试题数量，修改试卷分和试题数量
    int updateQtypeScoreAndNum(@Param("mptid") Integer mptid,@Param("mpid") Integer mpid);

    //获取试卷中所有试题基础信息
    List<MsPaperQtype> listQtypeQuestionSimple(@Param("mpid") Integer mpid);

    //批量修改题型排序-线下
    int updateBatchQtypeOrder(@Param("list")List<MsPaperQtype> list);
    //批量修改题型排序-移动-线下
    int updateBatchMoveQtypeOrder(@Param("list")List<MsPaperQtype> list);

    //题型移动-获取要交换位置的题型
    MsPaperQtype getQtypeForMoverOrder(@Param("p") MsPaperParams p);
}
