package com.yc.ship.module.ota.dal.mysql.distributorselfrecharge;

import com.yc.ship.framework.common.pojo.PageResult;
import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
import com.yc.ship.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yc.ship.module.ota.controller.admin.distributorselfrecharge.vo.DistributorSelfRechargePageReqVO;
import com.yc.ship.module.ota.dal.dataobject.distributorselfrecharge.DistributorSelfRechargeDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 自助充值明细 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface DistributorSelfRechargeMapper extends BaseMapperX<DistributorSelfRechargeDO> {

    default PageResult<DistributorSelfRechargeDO> selectPage(DistributorSelfRechargePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DistributorSelfRechargeDO>()
                .eqIfPresent(DistributorSelfRechargeDO::getDistributorId, reqVO.getDistributorId())
                .eqIfPresent(DistributorSelfRechargeDO::getAccountId, reqVO.getAccountId())
                .eqIfPresent(DistributorSelfRechargeDO::getPayType, reqVO.getPayType())
                .likeIfPresent(DistributorSelfRechargeDO::getAccountName, reqVO.getAccountName())
                .eqIfPresent(DistributorSelfRechargeDO::getMoney, reqVO.getMoney())
                .eqIfPresent(DistributorSelfRechargeDO::getIcCard, reqVO.getIcCard())
                .eqIfPresent(DistributorSelfRechargeDO::getRechargeState, reqVO.getRechargeState())
                .eqIfPresent(DistributorSelfRechargeDO::getRechargeLogId, reqVO.getRechargeLogId())
                .eqIfPresent(DistributorSelfRechargeDO::getPayOrderId, reqVO.getPayOrderId())
                .betweenIfPresent(DistributorSelfRechargeDO::getCreateTime, reqVO.getCreateTime())
                .betweenIfPresent(DistributorSelfRechargeDO::getUpdateTime, reqVO.getUpdateTime())
                .orderByDesc(DistributorSelfRechargeDO::getId));
    }

}
