package com.hzs.system.config.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.core.utils.DateUtils;
import com.hzs.common.domain.system.config.BdWithdrawalProcess;
import com.hzs.system.config.mapper.BdWithdrawalProcessMapper;
import com.hzs.system.config.service.IBdWithdrawalProcessService;
import org.springframework.stereotype.Service;

/**
 * 提现手续费配置 服务实现类
 */
@Service
public class BdWithdrawalProcessServiceImpl extends ServiceImpl<BdWithdrawalProcessMapper, BdWithdrawalProcess> implements IBdWithdrawalProcessService {

    @Override
    public BdWithdrawalProcess queryBdWithdrawalProcess(Integer pkCountry) {
        LambdaQueryWrapper<BdWithdrawalProcess> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(BdWithdrawalProcess::getPkCountry, pkCountry);
        queryWrapper.le(BdWithdrawalProcess::getEffectiveDate, DateUtils.currentDateTime());
        return baseMapper.selectOne(queryWrapper);
    }
}
