package jnpf.cultivate.mapper;

import jnpf.base.mapper.SuperMapper;
import jnpf.model.cultivate.po.question.FtbCultivateQuestion;
import jnpf.model.cultivate.resp.PaperDrawRuleVo;
import jnpf.model.cultivate.resp.QuestionCountDto;
import jnpf.model.cultivate.v2.exam.po.CultivateExamDrawRule;
import jnpf.model.cultivate.v2.exam.vo.BankPickVo;
import jnpf.model.cultivate.v2.exam.vo.QuestionTypeAnalysisVo;
import jnpf.model.cultivate.v2.exam.vo.QuestionVo;
import jnpf.model.cultivate.v2.exam.vo.V2AppQuestionVo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
/**
 * 题目表mapper
 *
 * @author xgl
 * @create 2024-09-29
 */
public interface FtbCultivateQuestionMapper extends SuperMapper<FtbCultivateQuestion> {
    /**
     * 根据题库id查询题库中重复题目
     *
     * @param questionBankId 题库ID
     * @return
     */
    List<FtbCultivateQuestion> queryRepeatQuestion(@Param("questionBankId") String questionBankId);
    /**
     * 根据题库id统计各题库的题目数量
     * @param ids 题库id集合
     * @return
     */
    List<QuestionCountDto> countForClassifyId(@Param("ids") List<String> ids);

    /**
     * 在题库中根据规则随机抽题
     * @param ruleList 规则列表
     * @param drawDataBase 题库
     * @return java.util.List<jnpf.model.cultivate.v2.exam.vo.V2AppQuestionVo>
     */
    List<V2AppQuestionVo> getRandQuestionByRule(@Param("ruleList") List<CultivateExamDrawRule> ruleList, @Param("drawDataBase") String drawDataBase);

    /**
     * 根据题目ids查询题目
     * @param questionIds 题目ids
     * @return java.util.List<jnpf.model.cultivate.v2.exam.vo.V2AppQuestionVo>
     */
    List<V2AppQuestionVo> selectListById(@Param("questionIds") List<String> questionIds);

    /**
     * 题型统计
     * @param bankIdList 题库ids
     * @return java.util.List<jnpf.model.cultivate.v2.exam.vo.QuestionTypeAnalysisVo>
     */
    List<QuestionTypeAnalysisVo> getTypeAnalysis(@Param("list") List<String> bankIdList);

    /**
     * 查询题目列表
     * @param bankIds 题库ids
     * @param keyword 关键字
     * @return java.util.List<jnpf.model.cultivate.v2.exam.vo.QuestionVo>
     */
    List<QuestionVo> getQuestionList(@Param("list") List<String> bankIds, @Param("keyword") String keyword);

    /**
     * 查询题库题型数量
     * @param bankPickList 题库抽题列表
     * @return java.util.List<jnpf.model.cultivate.v2.exam.vo.BankPickVo>
     */
    List<BankPickVo> getBankQuestionTypeCount(@Param("bankPickList") List<BankPickVo> bankPickList);

    /**
     * 查询试卷抽题规则
     * @param paperIds 试卷ids
     * @return java.util.List<jnpf.model.cultivate.resp.PaperDrawRuleVo>
     */
    List<PaperDrawRuleVo> getPaperDrawRuleList(@Param("paperIds") List<String> paperIds);
}