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

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

/**
 * 北京大学-问卷结果 Mapper
 *
 * @author lyb
 */
@Mapper
public interface QuestionnaireResultMapper extends BaseMapperX<QuestionnaireResultDO> {

    default PageResult<QuestionnaireResultDO> selectPage(QuestionnaireResultPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<QuestionnaireResultDO>()
                .eqIfPresent(QuestionnaireResultDO::getBqrUserId, reqVO.getBqrUserId())
                .eqIfPresent(QuestionnaireResultDO::getBqrQuestionnaireId, reqVO.getBqrQuestionnaireId())
                .eqIfPresent(QuestionnaireResultDO::getBqrStatus, reqVO.getBqrStatus())
                .eqIfPresent(QuestionnaireResultDO::getBqrScore, reqVO.getBqrScore())
                .betweenIfPresent(QuestionnaireResultDO::getBqrStartTime, reqVO.getBqrStartTime())
                .betweenIfPresent(QuestionnaireResultDO::getBqrEndTime, reqVO.getBqrEndTime())
                .betweenIfPresent(QuestionnaireResultDO::getBqrQuestTime, reqVO.getBqrQuestTime())
                .betweenIfPresent(QuestionnaireResultDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(QuestionnaireResultDO::getId));
    }

}