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

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.tenantbalance.TenantBalanceDO;
import org.apache.ibatis.annotations.Mapper;
import com.yolo.keyboard.controller.admin.tenantbalance.vo.*;

/**
 * 租户余额 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface TenantBalanceMapper extends BaseMapperX<TenantBalanceDO> {

    default PageResult<TenantBalanceDO> selectPage(TenantBalancePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<TenantBalanceDO>()
                .eqIfPresent(TenantBalanceDO::getBalance, reqVO.getBalance())
                .eqIfPresent(TenantBalanceDO::getVersion, reqVO.getVersion())
                .eqIfPresent(TenantBalanceDO::getUpdatedAt, reqVO.getUpdatedAt())
                .orderByDesc(TenantBalanceDO::getId));
    }

}