package com.yh.saas.plugin.news.service;

import com.baomidou.mybatisplus.service.IService;
import com.yh.saas.plugin.news.entity.ExchangeRate;
import com.yh.saas.plugin.news.entity.view.ExchangeRateView;

import java.util.List;

/**
 * <p>
 * 记录汇率库信息 服务类
 * </p>
 *
 * @author zhaojz
 * @since 2019-11-26
 */
public interface IExchangeRateService extends IService<ExchangeRate> {

    /**
     * 根据币种和年月查询汇率
     *
     * @param currencyKey
     * @param yearMonth
     * @return
     */
    Double getExchangeRate(String currencyKey, String yearMonth);

    /**
     * 查询汇率信息
     *
     * @param example
     * @return
     */
    List<ExchangeRate> getListByCondition(ExchangeRate example);

    /**
     * 保存汇率信息
     *
     * @param rateViewList
     */
    void saveRate(List<ExchangeRateView> rateViewList);

    /**
     * 查询当前公司某币种某月份汇率
     */
    Double getExchangeRateByCurrencyKeyAndDate(ExchangeRate info);
}

