package cn.iocoder.byzs.module.bjdx.dal.mysql.questionnaire;

import java.util.*;

import cn.iocoder.byzs.framework.common.pojo.PageResult;
import cn.iocoder.byzs.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.byzs.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.byzs.module.bjdx.dal.dataobject.questionnaire.QuestionnaireDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.byzs.module.bjdx.controller.admin.questionnaire.vo.*;

/**
 * 问卷 Mapper
 *
 * @author lyb
 */
@Mapper
public interface QuestionnaireMapper extends BaseMapperX<QuestionnaireDO> {

    default PageResult<QuestionnaireDO> selectPage(QuestionnairePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<QuestionnaireDO>()
                .likeIfPresent(QuestionnaireDO::getBqQuestionnaire, reqVO.getBqQuestionnaire())
                .eqIfPresent(QuestionnaireDO::getBqDetails, reqVO.getBqDetails())
                .eqIfPresent(QuestionnaireDO::getBqOrder, reqVO.getBqOrder())
                .eqIfPresent(QuestionnaireDO::getBqStartInfo, reqVO.getBqStartInfo())
                .eqIfPresent(QuestionnaireDO::getBqEndInfo, reqVO.getBqEndInfo())
                .eqIfPresent(QuestionnaireDO::getBqQuestIds, reqVO.getBqQuestIds())
                .betweenIfPresent(QuestionnaireDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(QuestionnaireDO::getId));
    }

    List<ConfigQuestionRespVO> selectConfigQuestionList(ConfigQuestionRespVO configQuestionRespVO);

    List<ConfigQuestionRespVO> selectConfigQuestionNoList(ConfigQuestionRespVO configQuestionRespVO);


    /**
     * 添加问卷试题配置
     *
     * @param configQuestionRespVO 编号
     */
    void addConfigQuest(ConfigQuestionRespVO configQuestionRespVO);

    /**
     * 删除问卷试题配置
     *
     * @param configQuestionRespVO 编号
     */
    void delConfigQuest(ConfigQuestionRespVO configQuestionRespVO);

}