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

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

/**
 * 微信付款码订单 Mapper
 *
 * @author 我是秦俊旗
 */
@Mapper
public interface WxStoreOrderMapper extends BaseMapperX<WxStoreOrderDO> {

    default PageResult<WxStoreOrderDO> selectPage(WxStoreOrderPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WxStoreOrderDO>()
                .eqIfPresent(WxStoreOrderDO::getTotalPrice, reqVO.getTotalPrice())
                .eqIfPresent(WxStoreOrderDO::getCarteenId, reqVO.getCarteenId())
                .eqIfPresent(WxStoreOrderDO::getAuthCode, reqVO.getAuthCode())
                .eqIfPresent(WxStoreOrderDO::getOutTradeNo, reqVO.getOutTradeNo())
                .eqIfPresent(WxStoreOrderDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(WxStoreOrderDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WxStoreOrderDO::getId));
    }

}