package com.phlx.anchorcollect.entity;

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

import androidx.databinding.BaseObservable;

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


/**
 * 免疫记录字对象 zxgl_immunebatch_detail
 *
 * @author phlx
 * @date 2022-03-01
 */
@Entity
public class ImmuneBatchDetailEntity extends BaseObservable implements Parcelable {

    /**
     * unid
     */
    @Id(autoincrement = false)
    private Long unid;

    /**
     * 基础信息unid
     */
    private Long cattleresumeUnid;

    /**
     * 免疫记录unid
     */
    private Long immunebatchUnid;

    /**
     * 部门id
     */
    private Long deptId;


    /** 是否上传 0未上传，1已上传 */
    private String uploadStatus;

    public ImmuneBatchDetailEntity() {
    }

    protected ImmuneBatchDetailEntity(Parcel in) {
        if (in.readByte() == 0) {
            unid = null;
        } else {
            unid = in.readLong();
        }
        if (in.readByte() == 0) {
            cattleresumeUnid = null;
        } else {
            cattleresumeUnid = in.readLong();
        }
        if (in.readByte() == 0) {
            immunebatchUnid = null;
        } else {
            immunebatchUnid = in.readLong();
        }
        if (in.readByte() == 0) {
            deptId = null;
        } else {
            deptId = in.readLong();
        }
        uploadStatus = in.readString();
    }

    @Generated(hash = 1563550765)
    public ImmuneBatchDetailEntity(Long unid, Long cattleresumeUnid, Long immunebatchUnid, Long deptId,
            String uploadStatus) {
        this.unid = unid;
        this.cattleresumeUnid = cattleresumeUnid;
        this.immunebatchUnid = immunebatchUnid;
        this.deptId = deptId;
        this.uploadStatus = uploadStatus;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        if (unid == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeLong(unid);
        }
        if (cattleresumeUnid == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeLong(cattleresumeUnid);
        }
        if (immunebatchUnid == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeLong(immunebatchUnid);
        }
        if (deptId == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeLong(deptId);
        }
        dest.writeString(uploadStatus);
    }

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

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

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

    public Long getUnid() {
        return unid;
    }

    public void setUnid(Long unid) {
        this.unid = unid;
    }

    public Long getCattleresumeUnid() {
        return cattleresumeUnid;
    }

    public void setCattleresumeUnid(Long cattleresumeUnid) {
        this.cattleresumeUnid = cattleresumeUnid;
    }

    public Long getImmunebatchUnid() {
        return immunebatchUnid;
    }

    public void setImmunebatchUnid(Long immunebatchUnid) {
        this.immunebatchUnid = immunebatchUnid;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public String getUploadStatus() {
        return uploadStatus;
    }

    public void setUploadStatus(String uploadStatus) {
        this.uploadStatus = uploadStatus;
    }

    @Override
    public String toString() {
        return "ImmuneBatchDetailEntity{" +
                "unid='" + unid + '\'' +
                ", cattleresumeUnid='" + cattleresumeUnid + '\'' +
                ", immunebatchUnid='" + immunebatchUnid + '\'' +
                ", deptId='" + deptId + '\'' +
                ", uploadStatus='" + uploadStatus + '\'' +
                '}';
    }
}
