package com.xhkjedu.sstudy.service.paper;

import com.xhkjedu.sstudy.mapper.paper.PaperQtypeQuestionMapper;
import com.xhkjedu.sstudy.model.paper.TPaperQtypeQuestion;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author ywx
 * @classname PaperQtypeQuestionService
 * @description 
 * @date 2020/6/10 9:20
 **/
@Service
public class PaperQtypeQuestionService {
    @Resource
    private PaperQtypeQuestionMapper paperQtypeQuestionMapper;

    /**
     * 上传试卷按题型统计(只统计母题)
     * @Param [paperid]
     * @Author ywx
     * @Date 2020/6/6 17:26
     * @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
     **/
    public List<Map<String, Object>> paperTypeAnalyze(Integer paperid) {
        return paperQtypeQuestionMapper.paperTypeAnalyze(paperid);
    }

    /**
     * 上传试卷按难易度统计(只统计母题)
     * @Param [paperid]
     * @Author ywx
     * @Date 2020/6/6 17:28
     * @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
     **/
    public List<Map<String, Object>> complexityRateAnalyze(Integer paperid) {
        return paperQtypeQuestionMapper.complexityRateAnalyze(paperid);
    }

    /**
     * 上传试卷按知识点统计(只统计母题)
     * @Param [paperid]
     * @Author ywx
     * @Date 2020/6/6 17:29
     * @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
     **/
    public List<Map<String, Object>> pointRateAnalyze(Integer paperid) {
        return paperQtypeQuestionMapper.pointRateAnalyze(paperid);
    }

    /**
     * 批量保存
     * @Param [ptqs]
     * @Author ywx
     * @Date 2020/6/10 9:26
     * @return void
     **/
    public void batchSave(List<TPaperQtypeQuestion> ptqs) {
        paperQtypeQuestionMapper.insertList(ptqs);
    }
}
