package com.phlx.wool.entity;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.databinding.BaseObservable;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Index;

/**
 * <pre>
 *     author : lei
 *     e-mail : 18600395998@163.com
 *     time   : 2020/04/10
 *     desc   : 发标记录表
 *     version: 1.0
 * </pre>
 */
@Entity
public class QuarantineDetail extends BaseObservable implements Parcelable {

    @Id(autoincrement = true)
    @Expose(serialize = false, deserialize = false)
    private Long id;

    /**
     * 主表ID
     */
    @Index(name = "quarantineId")
    private Long quarantineId;

    /**
     * 养殖单位ID
     */
    @SerializedName("preflagunit")
    private String receivingUnit;

    /**
     * 耳标EPC
     */
    @SerializedName("slugno")
    private String Epc;

    /**
     * 二维码号
     */
    @SerializedName("twodimensionno")
    private String twodimensionno;

    /**
     * 耳标tid
     */
    @Index(name = "QuarantineTid", unique = true)
    @SerializedName("innercode")
    private String Tid;


    /**
     * 合法状态 0 非法 1 合法
     */
    @SerializedName("qualified")
    private String isLegalStatus;


    @SerializedName("inputTime")
    private long timestamp;

    /** 创建者 */
    private String createBy;

    /**
     * 创建时间
     */
    @Expose(serialize = false, deserialize = false)
    private String createTime;

    @Generated(hash = 1676464898)
    public QuarantineDetail(Long id, Long quarantineId, String receivingUnit,
            String Epc, String twodimensionno, String Tid, String isLegalStatus,
            long timestamp, String createBy, String createTime) {
        this.id = id;
        this.quarantineId = quarantineId;
        this.receivingUnit = receivingUnit;
        this.Epc = Epc;
        this.twodimensionno = twodimensionno;
        this.Tid = Tid;
        this.isLegalStatus = isLegalStatus;
        this.timestamp = timestamp;
        this.createBy = createBy;
        this.createTime = createTime;
    }

    @Generated(hash = 1582101677)
    public QuarantineDetail() {
    }

    protected QuarantineDetail(Parcel in) {
        if (in.readByte() == 0) {
            id = null;
        } else {
            id = in.readLong();
        }
        if (in.readByte() == 0) {
            quarantineId = null;
        } else {
            quarantineId = in.readLong();
        }
        receivingUnit = in.readString();
        Epc = in.readString();
        twodimensionno = in.readString();
        Tid = in.readString();
        isLegalStatus = in.readString();
        timestamp = in.readLong();
        createBy = in.readString();
        createTime = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        if (id == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeLong(id);
        }
        if (quarantineId == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeLong(quarantineId);
        }
        dest.writeString(receivingUnit);
        dest.writeString(Epc);
        dest.writeString(twodimensionno);
        dest.writeString(Tid);
        dest.writeString(isLegalStatus);
        dest.writeLong(timestamp);
        dest.writeString(createBy);
        dest.writeString(createTime);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<QuarantineDetail> CREATOR = new Creator<QuarantineDetail>() {
        @Override
        public QuarantineDetail createFromParcel(Parcel in) {
            return new QuarantineDetail(in);
        }

        @Override
        public QuarantineDetail[] newArray(int size) {
            return new QuarantineDetail[size];
        }
    };

    public Long getId() {
        return this.id;
    }

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

    public Long getQuarantineId() {
        return this.quarantineId;
    }

    public void setQuarantineId(Long quarantineId) {
        this.quarantineId = quarantineId;
    }

    public String getReceivingUnit() {
        return this.receivingUnit;
    }

    public void setReceivingUnit(String receivingUnit) {
        this.receivingUnit = receivingUnit;
    }

    public String getEpc() {
        return this.Epc;
    }

    public void setEpc(String Epc) {
        this.Epc = Epc;
    }

    public String getTwodimensionno() {
        return this.twodimensionno;
    }

    public void setTwodimensionno(String twodimensionno) {
        this.twodimensionno = twodimensionno;
    }

    public String getTid() {
        return this.Tid;
    }

    public void setTid(String Tid) {
        this.Tid = Tid;
    }

    public String getIsLegalStatus() {
        return this.isLegalStatus;
    }

    public void setIsLegalStatus(String isLegalStatus) {
        this.isLegalStatus = isLegalStatus;
    }

    public long getTimestamp() {
        return this.timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public String getCreateBy() {
        return this.createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "QuarantineDetail{" +
                "id=" + id +
                ", quarantineId=" + quarantineId +
                ", receivingUnit='" + receivingUnit + '\'' +
                ", Epc='" + Epc + '\'' +
                ", twodimensionno='" + twodimensionno + '\'' +
                ", Tid='" + Tid + '\'' +
                ", isLegalStatus='" + isLegalStatus + '\'' +
                ", timestamp=" + timestamp +
                ", createBy='" + createBy + '\'' +
                ", createTime='" + createTime + '\'' +
                '}';
    }
}
