package com.yolo.keyboard.dal.mysql.themepurchase;

import java.util.*;

import com.yolo.keyboard.framework.common.pojo.PageResult;
import com.yolo.keyboard.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yolo.keyboard.framework.mybatis.core.mapper.BaseMapperX;
import com.yolo.keyboard.dal.dataobject.themepurchase.KeyboardThemePurchaseDO;
import org.apache.ibatis.annotations.Mapper;
import com.yolo.keyboard.controller.admin.themepurchase.vo.*;

/**
 * 皮肤购买记录表（积分支付） Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface KeyboardThemePurchaseMapper extends BaseMapperX<KeyboardThemePurchaseDO> {

    default PageResult<KeyboardThemePurchaseDO> selectPage(KeyboardThemePurchasePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<KeyboardThemePurchaseDO>()
                .eqIfPresent(KeyboardThemePurchaseDO::getOrderNo, reqVO.getOrderNo())
                .eqIfPresent(KeyboardThemePurchaseDO::getUserId, reqVO.getUserId())
                .eqIfPresent(KeyboardThemePurchaseDO::getThemeId, reqVO.getThemeId())
                .eqIfPresent(KeyboardThemePurchaseDO::getCostPoints, reqVO.getCostPoints())
                .eqIfPresent(KeyboardThemePurchaseDO::getPaidPoints, reqVO.getPaidPoints())
                .eqIfPresent(KeyboardThemePurchaseDO::getPayStatus, reqVO.getPayStatus())
                .eqIfPresent(KeyboardThemePurchaseDO::getWalletTxId, reqVO.getWalletTxId())
                .eqIfPresent(KeyboardThemePurchaseDO::getRefundPoints, reqVO.getRefundPoints())
                .eqIfPresent(KeyboardThemePurchaseDO::getRefundedAt, reqVO.getRefundedAt())
                .eqIfPresent(KeyboardThemePurchaseDO::getCreatedAt, reqVO.getCreatedAt())
                .eqIfPresent(KeyboardThemePurchaseDO::getPaidAt, reqVO.getPaidAt())
                .eqIfPresent(KeyboardThemePurchaseDO::getUpdatedAt, reqVO.getUpdatedAt())
                .eqIfPresent(KeyboardThemePurchaseDO::getRemark, reqVO.getRemark())
                .orderByDesc(KeyboardThemePurchaseDO::getId));
    }

}