package cn.iocoder.yudao.module.member.dal.mysql.activityvoucheruser;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.member.dal.dataobject.activityvoucheruser.ActivityVoucherUserDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.member.controller.admin.activityvoucheruser.vo.*;

/**
 * 活动用户拥有代金券 Mapper
 *
 * @author 我是秦俊旗
 */
@Mapper
public interface ActivityVoucherUserMapper extends BaseMapperX<ActivityVoucherUserDO> {

    default PageResult<ActivityVoucherUserDO> selectPage(ActivityVoucherUserPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ActivityVoucherUserDO>()
                .eqIfPresent(ActivityVoucherUserDO::getVoucherId, reqVO.getVoucherId())
                .eqIfPresent(ActivityVoucherUserDO::getUserId, reqVO.getUserId())
                .eqIfPresent(ActivityVoucherUserDO::getMobile, reqVO.getMobile())
                .eqIfPresent(ActivityVoucherUserDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(ActivityVoucherUserDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ActivityVoucherUserDO::getId));
    }

}