package com.ynfy.buss.exam.paperrulegroup.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ynfy.buss.exam.exam.dto.QuestionTypeCountDTO;
import com.ynfy.buss.exam.paper.entity.Paper;
import com.ynfy.buss.exam.paperrulegroup.entity.PaperRuleGroup;

import java.util.List;

/**
 * @Description: paper_rule_group
 * @Author: jeecg-boot
 * @Date: 2023-02-22
 * @Version: V1.0
 */
public interface IPaperRuleGroupService extends IService<PaperRuleGroup> {

    /**
     * 保存试卷规则组
     */
    void saveAll(Paper paper, List<PaperRuleGroup> groupList);


    /**
     * 根据试卷id查询规则组
     */
    List<PaperRuleGroup> listByPaperId(String paperId);


    void remove(String paperId);

    void removeByQuestionIds(String[] paperIds);

    /**
     * 根据试卷id获取抽题规则组以及规则明细
     *
     * @param paperId
     * @return
     */
    List<PaperRuleGroup> listGroupAndDetail(String paperId);


    /**
     * 根据试卷id获取每种题型数量
     *
     * @param paperId
     * @return
     */
    List<QuestionTypeCountDTO> sumQuestionCount(String paperId);
}
