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

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.activitymerchant.ActivityMerchantDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.member.controller.admin.activitymerchant.vo.*;

/**
 * 活动商家 Mapper
 *
 * @author 我是秦俊旗
 */
@Mapper
public interface ActivityMerchantMapper extends BaseMapperX<ActivityMerchantDO> {

    default PageResult<ActivityMerchantDO> selectPage(ActivityMerchantPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ActivityMerchantDO>()
                .likeIfPresent(ActivityMerchantDO::getName, reqVO.getName())
                .eqIfPresent(ActivityMerchantDO::getPerson, reqVO.getPerson())
                .eqIfPresent(ActivityMerchantDO::getMobile, reqVO.getMobile())
                .betweenIfPresent(ActivityMerchantDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ActivityMerchantDO::getId));
    }

}