package com.uas.search.console.b2b.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created by 黄诚天 on 2017-10-13.
 * 供应商绩效考核
 */
@Table(name = VendorPerformanceAssessSimpleInfo.TABLE_NAME)
@Entity
public class VendorPerformanceAssessSimpleInfo {
    /**
     * 表名
     */
    public static final String TABLE_NAME = "VENDORPERFORMANCEASSESS";

    /**
     * 各字段列名（也是存储索引时的field名）
     */
    public static final String ID_FIELD = "id";

    public static final String VPAID_FIELD = "vpa_id";

    public static final String CODE_FIELD = "vpa_code";

    public static final String ENTERPRISE_FIELD = "enuu";

    public static final String DATE_FIELD = "vpa_applydate";

    public static final String VPAENUU_FIELD = "vpa_veuu";

    /**
     * 主键ID
     */
    @Id
    @Column(name = ID_FIELD)
    private Long id;

    /**
     *单据ID
     */
    @Column(name = VPAID_FIELD)
    private Long vpaId;

    /**
     *单据编号
     */
    @Column(name = CODE_FIELD)
    private String vpaCode;

    /**
     *本企业UU
     */
    @Column(name = ENTERPRISE_FIELD)
    private Long enUU;

    /**
     * 日期
     */
    @Column(name = DATE_FIELD)
    private Date vpaApplydate;

    /**
     *供应商企业UU
     */
    @Column(name = VPAENUU_FIELD)
    private Long vpaVeuu;

    public Long getId() {
        return id;
    }

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

    public Long getVpaId() {
        return vpaId;
    }

    public void setVpaId(Long vpaId) {
        this.vpaId = vpaId;
    }

    public String getVpaCode() {
        return vpaCode;
    }

    public void setVpaCode(String vpaCode) {
        this.vpaCode = vpaCode;
    }

    public Long getEnUU() {
        return enUU;
    }

    public void setEnUU(Long enUU) {
        this.enUU = enUU;
    }

    public Date getVpaApplydate() {
        return vpaApplydate;
    }

    public void setVpaApplydate(Date vpaApplydate) {
        this.vpaApplydate = vpaApplydate;
    }

    public Long getVpaVeuu() {
        return vpaVeuu;
    }

    public void setVpaVeuu(Long vpaVeuu) {
        this.vpaVeuu = vpaVeuu;
    }

    /**
     * 获取所有可以搜索的字段列名（索引的field名）
     *
     * @return 可以搜索的字段列名
     */
    public static List<String> getKeywordFields() {
        List<String> fields = new ArrayList<>();
        fields.add(CODE_FIELD);
        fields.add(ENTERPRISE_FIELD);
        fields.add(VPAENUU_FIELD);
        return fields;
    }

    @Override
    public String toString() {
        return "VendorPerformanceAssessSimpleInfo{" +
                "id=" + id +
                ", vpaId=" + vpaId +
                ", vpaCode='" + vpaCode + '\'' +
                ", enUU=" + enUU +
                ", vpaApplydate=" + vpaApplydate +
                ", vpaVeuu=" + vpaVeuu +
                '}';
    }
}
