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

import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.yh.saas.common.support.entity.BaseModel;
import com.yh.saas.common.support.util.query.SearchField;
import com.yh.saas.common.support.util.query.SearchMode;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * <p>
 * 记录汇率库信息
 * </p>
 *
 * @author DAH
 * @since 2020-06-22
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("news_exchange_rate")
public class ExchangeRate extends BaseModel<ExchangeRate> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(type = IdType.UUID)
    private String id;
    /**
     * 公司ID
     */
    @SearchField(mode = SearchMode.EQ)
    private String compId;
    /**
     * 币种标识
     */
    private String currencyKey;
    /**
     * 币种
     */
    private String currencyValue;
    /**
     * 汇率年月
     */
    private String rateYearMonth;
    /**
     * 汇率
     */
    private Double exchangeRate;

    @Override
    protected Serializable pkVal() {
            return this.id;
            }

    /**
     * 查询类
     */
    public static class QueryFileds {

        public static final String COMP_ID = "comp_id";

        public static final String YEAR_MONTH = "rate_year_month";

        public static final String CURRENCY_KEY = "currency_key";

        private QueryFileds() {
        }
    }
}