package com.huimv.admin.domain.primary;

import com.huimv.admin.EntityBase;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.util.Date;

/**
 * 组织信息表
 * @author guojian
 */
@Entity(name="organize_info")
@DynamicInsert(true)
@DynamicUpdate(true)
public class OrganizeInfo extends EntityBase {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    private String orgName;

    //法人
    private String legalPersons;

    //企业编号（工商号）
    private String orgCode;

    @Column(columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
    private Date updated;

    @Column(columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", updatable = false)
    private Date created;

    public Integer getId() {
        return id;
    }

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

    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    public String getLegalPersons() {
        return legalPersons;
    }

    public void setLegalPersons(String legalPersons) {
        this.legalPersons = legalPersons;
    }

    public String getOrgCode() {
        return orgCode;
    }

    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }

    public Date getUpdated() {
        return updated;
    }

    public void setUpdated(Date updated) {
        this.updated = updated;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    @Override
    public String toString() {
        return "OrganizeInfo{" +
                "id=" + id +
                ", orgName='" + orgName + '\'' +
                ", legalPersons='" + legalPersons + '\'' +
                ", orgCode='" + orgCode + '\'' +
                ", updated=" + updated +
                ", created=" + created +
                '}';
    }
}
