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

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

/**
 * 顾客流量 Mapper
 *
 * @author 开发账号
 */
@Mapper
public interface CustomerTrafficMapper extends BaseMapperX<CustomerTrafficDO> {

    default PageResult<CustomerTrafficDO> selectPage(CustomerTrafficPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CustomerTrafficDO>()
                .eqIfPresent(CustomerTrafficDO::getTimePoint, reqVO.getTimePoint())
                .eqIfPresent(CustomerTrafficDO::getStoreId, reqVO.getStoreId())
                .eqIfPresent(CustomerTrafficDO::getCustomerNum, reqVO.getCustomerNum())
                .betweenIfPresent(CustomerTrafficDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CustomerTrafficDO::getId));
    }

}