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

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.questionnaireresultdetails.QuestionnaireResultDetailsDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.byzs.module.bjdx.controller.admin.questionnaireresultdetails.vo.*;

/**
 * 北京大学-问卷结果-详情 Mapper
 *
 * @author lyb
 */
@Mapper
public interface QuestionnaireResultDetailsMapper extends BaseMapperX<QuestionnaireResultDetailsDO> {

    default PageResult<QuestionnaireResultDetailsDO> selectPage(QuestionnaireResultDetailsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<QuestionnaireResultDetailsDO>()
                .eqIfPresent(QuestionnaireResultDetailsDO::getBqrdUserId, reqVO.getBqrdUserId())
                .eqIfPresent(QuestionnaireResultDetailsDO::getBqrdQuestionnaireResultId, reqVO.getBqrdQuestionnaireResultId())
                .eqIfPresent(QuestionnaireResultDetailsDO::getBqrdQuestionnaireId, reqVO.getBqrdQuestionnaireId())
                .eqIfPresent(QuestionnaireResultDetailsDO::getBqrdQuestionId, reqVO.getBqrdQuestionId())
                .eqIfPresent(QuestionnaireResultDetailsDO::getBqrdQuestOptionId, reqVO.getBqrdQuestOptionId())
                .eqIfPresent(QuestionnaireResultDetailsDO::getBqrdIsCorrect, reqVO.getBqrdIsCorrect())
                .eqIfPresent(QuestionnaireResultDetailsDO::getBqrdQuestScore, reqVO.getBqrdQuestScore())
                .betweenIfPresent(QuestionnaireResultDetailsDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(QuestionnaireResultDetailsDO::getId));
    }

}