package com.quantgroup.asset.distribution.service.jpa.entity;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

/**
 * @author shihuajun
 * @date 2021/9/12 14:33
 * @ describing
 */
@Entity
@Table(name = "fund_product", schema = "asset-distribution", catalog = "")
@DynamicInsert
@DynamicUpdate
public class FundProductEntity {
    private Long id;
    private Long fundId;
    private Long fundProId;
    private String fundName;
    private String fundType;
    private String orgType;
    private String businessType;
    private String systermType;

    private String basicRule;
    private int areaTerm;
    private int cardLimit;
    private String telRule;
    private String areaRule;
    private String ruleList;
    private Byte enable;
    private Timestamp createdAt;
    private Timestamp updatedAt;

    @Id
    @GeneratedValue
    @Column(name = "id", nullable = false)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "fund_id", nullable = false)
    public Long getFundId() {
        return fundId;
    }

    public void setFundId(Long fundId) {
        this.fundId = fundId;
    }

    @Basic
    @Column(name = "fund_pro_id", nullable = false)
    public Long getFundProId() {
        return fundProId;
    }

    public void setFundProId(Long fundProId) {
        this.fundProId = fundProId;
    }

    @Basic
    @Column(name = "fund_name", nullable = false, length = 100)
    public String getFundName() {
        return fundName;
    }

    public void setFundName(String fundName) {
        this.fundName = fundName;
    }

    @Basic
    @Column(name = "fund_type", nullable = false, length = 20)
    public String getFundType() {
        return fundType;
    }

    public void setFundType(String fundType) {
        this.fundType = fundType;
    }

    @Basic
    @Column(name = "org_type", nullable = false, length = 20)
    public String getOrgType() {
        return orgType;
    }

    public void setOrgType(String orgType) {
        this.orgType = orgType;
    }

    @Basic
    @Column(name = "business_type", nullable = false, length = 20)
    public String getBusinessType() {
        return businessType;
    }

    public void setBusinessType(String businessType) {
        this.businessType = businessType;
    }

    @Basic
    @Column(name = "systerm_type", nullable = false, length = 20)
    public String getSystermType() {
        return systermType;
    }

    public void setSystermType(String systermType) {
        this.systermType = systermType;
    }

    @Basic
    @Column(name = "basic_rule", nullable = false, length = 500)
    public String getBasicRule() {
        return basicRule;
    }

    public void setBasicRule(String basicRule) {
        this.basicRule = basicRule;
    }

    @Basic
    @Column(name = "area_term", nullable = false)
    public int getAreaTerm() {
        return areaTerm;
    }

    public void setAreaTerm(int areaTerm) {
        this.areaTerm = areaTerm;
    }

    @Basic
    @Column(name = "card_limit", nullable = false)
    public int getCardLimit() {
        return cardLimit;
    }

    public void setCardLimit(int cardLimit) {
        this.cardLimit = cardLimit;
    }

    @Basic
    @Column(name = "tel_rule", nullable = false, length = 500)
    public String getTelRule() {
        return telRule;
    }

    public void setTelRule(String telRule) {
        this.telRule = telRule;
    }

    @Basic
    @Column(name = "area_rule", nullable = false, length = 500)
    public String getAreaRule() {
        return areaRule;
    }

    public void setAreaRule(String areaRule) {
        this.areaRule = areaRule;
    }

    @Basic
    @Column(name = "rule_list", nullable = false, length = 500)
    public String getRuleList() {
        return ruleList;
    }

    public void setRuleList(String ruleList) {
        this.ruleList = ruleList;
    }

    @Basic
    @Column(name = "enable", nullable = true)
    public Byte getEnable() {
        return enable;
    }

    public void setEnable(Byte enable) {
        this.enable = enable;
    }

    @Basic
    @Column(name = "created_at", nullable = false)
    public Timestamp getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Timestamp createdAt) {
        this.createdAt = createdAt;
    }

    @Basic
    @Column(name = "updated_at", nullable = false)
    public Timestamp getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Timestamp updatedAt) {
        this.updatedAt = updatedAt;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        FundProductEntity that = (FundProductEntity) o;
        return id == that.id && fundId == that.fundId && fundProId == that.fundProId && areaTerm == that.areaTerm && cardLimit == that.cardLimit && Objects.equals(fundName, that.fundName) && Objects.equals(fundType, that.fundType) && Objects.equals(orgType, that.orgType) && Objects.equals(businessType, that.businessType) && Objects.equals(systermType, that.systermType) && Objects.equals(basicRule, that.basicRule) && Objects.equals(telRule, that.telRule) && Objects.equals(areaRule, that.areaRule) && Objects.equals(ruleList, that.ruleList) && Objects.equals(enable, that.enable) && Objects.equals(createdAt, that.createdAt) && Objects.equals(updatedAt, that.updatedAt);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, fundId, fundProId, fundName, fundType, orgType, businessType, systermType, basicRule, areaTerm, cardLimit, telRule, areaRule, ruleList, enable, createdAt, updatedAt);
    }
}
