package com.huimv.manage.eartag.dao.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Date;
import java.sql.Timestamp;

@EntityListeners(AuditingEntityListener.class)
@Entity
@Table(name = "et_apply")
public class EtApplyEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Integer id;

    @CreatedDate
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    @Column(name = "download_time")
    private Timestamp downloadTime;

    @Column(name = "mission_processor")
    private String missionProcessor;

    @Column(name = "org_id")
    private String orgId;

    @Column(name = "org_name")
    private String orgName;

    @Column(name = "org_address")
    private String orgAddress;

    @Column(name = "org_linkman")
    private String orgLinkman;

    @Column(name = "post_code")
    private String postCode;

    @Column(name = "org_tel")
    private String orgTel;

    @Column(name = "apply_id")
    private Integer applyId;

    @Column(name = "assigned_date")
    private String assignedDate;

    @Column(name = "earmark_amount")
    private Integer earmarkAmount;

    @Column(name = "real_earmark_amount")
    private Integer realEarmarkAmount;

    @Column(name = "consignment_date")
    private String consignmentDate;

    @Column(name = "apply_region_name")
    private String applyRegionName;

    @Column(name = "animal_type")
    private String animalType;

    @Column(name = "animal_type_name")
    private String animalTypeName;

    @Column(name = "set_down_state")
    private Integer setDownState;

//    @CreatedDate
//    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    @Column(name = "set_down_date")
    private Timestamp setDownDate;

    @Column(name = "deliver_state")
    private Integer deliverState;

//    @CreatedDate
//    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    @Column(name = "deliver_date")
    private Date deliverDate;

    @CreatedDate
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    @Column(name = "commit_time")
    private Timestamp commitTime;

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

    public Integer getId() {
        return id;
    }

    public void setDownloadTime(Timestamp downloadTime) {
        this.downloadTime = downloadTime;
    }

    public Timestamp getDownloadTime() {
        return downloadTime;
    }

    public void setMissionProcessor(String missionProcessor) {
        this.missionProcessor = missionProcessor;
    }

    public String getMissionProcessor() {
        return missionProcessor;
    }

    public void setOrgId(String orgId) {
        this.orgId = orgId;
    }

    public String getOrgId() {
        return orgId;
    }

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

    public String getOrgName() {
        return orgName;
    }

    public void setOrgAddress(String orgAddress) {
        this.orgAddress = orgAddress;
    }

    public String getOrgAddress() {
        return orgAddress;
    }

    public void setOrgLinkman(String orgLinkman) {
        this.orgLinkman = orgLinkman;
    }

    public String getOrgLinkman() {
        return orgLinkman;
    }

    public void setPostCode(String postCode) {
        this.postCode = postCode;
    }

    public String getPostCode() {
        return postCode;
    }

    public void setOrgTel(String orgTel) {
        this.orgTel = orgTel;
    }

    public String getOrgTel() {
        return orgTel;
    }

    public void setApplyId(Integer applyId) {
        this.applyId = applyId;
    }

    public Integer getApplyId() {
        return applyId;
    }

    public void setAssignedDate(String assignedDate) {
        this.assignedDate = assignedDate;
    }

    public String getAssignedDate() {
        return assignedDate;
    }

    public void setEarmarkAmount(Integer earmarkAmount) {
        this.earmarkAmount = earmarkAmount;
    }

    public Integer getEarmarkAmount() {
        return earmarkAmount;
    }

    public void setRealEarmarkAmount(Integer realEarmarkAmount) {
        this.realEarmarkAmount = realEarmarkAmount;
    }

    public Integer getRealEarmarkAmount() {
        return realEarmarkAmount;
    }

    public void setConsignmentDate(String consignmentDate) {
        this.consignmentDate = consignmentDate;
    }

    public String getConsignmentDate() {
        return consignmentDate;
    }

    public void setApplyRegionName(String applyRegionName) {
        this.applyRegionName = applyRegionName;
    }

    public String getApplyRegionName() {
        return applyRegionName;
    }

    public void setAnimalType(String animalType) {
        this.animalType = animalType;
    }

    public String getAnimalType() {
        return animalType;
    }

    public void setAnimalTypeName(String animalTypeName) {
        this.animalTypeName = animalTypeName;
    }

    public String getAnimalTypeName() {
        return animalTypeName;
    }

    public void setSetDownState(Integer setDownState) {
        this.setDownState = setDownState;
    }

    public Integer getSetDownState() {
        return setDownState;
    }

    public void setSetDownDate(Timestamp setDownDate) {
        this.setDownDate = setDownDate;
    }

    public Timestamp getSetDownDate() {
        return setDownDate;
    }

    public void setDeliverState(Integer deliverState) {
        this.deliverState = deliverState;
    }

    public Integer getDeliverState() {
        return deliverState;
    }

    public void setDeliverDate(Date deliverDate) {
        this.deliverDate = deliverDate;
    }

    public Date getDeliverDate() {
        return deliverDate;
    }

    public void setCommitTime(Timestamp commitTime) {
        this.commitTime = commitTime;
    }

    public Timestamp getCommitTime() {
        return commitTime;
    }

    @Override
    public String toString() {
        return "EtApplyEntity{" +
                "id=" + id + '\'' +
                "downloadTime=" + downloadTime + '\'' +
                "missionProcessor=" + missionProcessor + '\'' +
                "orgId=" + orgId + '\'' +
                "orgName=" + orgName + '\'' +
                "orgAddress=" + orgAddress + '\'' +
                "orgLinkman=" + orgLinkman + '\'' +
                "postCode=" + postCode + '\'' +
                "orgTel=" + orgTel + '\'' +
                "applyId=" + applyId + '\'' +
                "assignedDate=" + assignedDate + '\'' +
                "earmarkAmount=" + earmarkAmount + '\'' +
                "realEarmarkAmount=" + realEarmarkAmount + '\'' +
                "consignmentDate=" + consignmentDate + '\'' +
                "applyRegionName=" + applyRegionName + '\'' +
                "animalType=" + animalType + '\'' +
                "animalTypeName=" + animalTypeName + '\'' +
                "setDownState=" + setDownState + '\'' +
                "setDownDate=" + setDownDate + '\'' +
                "deliverState=" + deliverState + '\'' +
                "deliverDate=" + deliverDate + '\'' +
                "commitTime=" + commitTime + '\'' +
                '}';
    }
}
