package com.phlx.anchorcollect_p.entity;

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

import androidx.databinding.BaseObservable;

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

/**
 * 称重管理类
 */
@Entity
public class WeightManEntity extends BaseObservable implements Parcelable {

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

    /**
     * 基本信息ID
     */
    private Long cattleresumeId;

    /**
     * 体重
     */
    private Double weight;

    /** 称重日期 */
    private String wTime;

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

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

    /** 搜索值 */
    private String searchValue;

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

    /** 创建时间 */
    private String createTime;

    /** 更新者 */
    private String updateBy;

    /** 更新时间 */
    private String updateTime;

    /** 备注 */
    private String remark;

    public WeightManEntity() {
    }

    protected WeightManEntity(Parcel in) {
        if (in.readByte() == 0) {
            unid = null;
        } else {
            unid = in.readLong();
        }
        if (in.readByte() == 0) {
            cattleresumeId = null;
        } else {
            cattleresumeId = in.readLong();
        }
        if (in.readByte() == 0) {
            weight = null;
        } else {
            weight = in.readDouble();
        }
        wTime = in.readString();
        uploadStatus = in.readString();
        if (in.readByte() == 0) {
            deptId = null;
        } else {
            deptId = in.readLong();
        }
        searchValue = in.readString();
        createBy = in.readString();
        createTime = in.readString();
        updateBy = in.readString();
        updateTime = in.readString();
        remark = in.readString();
    }

    @Generated(hash = 90669287)
    public WeightManEntity(Long unid, Long cattleresumeId, Double weight, String wTime,
            String uploadStatus, Long deptId, String searchValue, String createBy,
            String createTime, String updateBy, String updateTime, String remark) {
        this.unid = unid;
        this.cattleresumeId = cattleresumeId;
        this.weight = weight;
        this.wTime = wTime;
        this.uploadStatus = uploadStatus;
        this.deptId = deptId;
        this.searchValue = searchValue;
        this.createBy = createBy;
        this.createTime = createTime;
        this.updateBy = updateBy;
        this.updateTime = updateTime;
        this.remark = remark;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        if (unid == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeLong(unid);
        }
        if (cattleresumeId == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeLong(cattleresumeId);
        }
        if (weight == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeDouble(weight);
        }
        dest.writeString(wTime);
        dest.writeString(uploadStatus);
        if (deptId == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeLong(deptId);
        }
        dest.writeString(searchValue);
        dest.writeString(createBy);
        dest.writeString(createTime);
        dest.writeString(updateBy);
        dest.writeString(updateTime);
        dest.writeString(remark);
    }

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

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

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

    public Long getUnid() {
        return unid;
    }

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

    public Long getCattleresumeId() {
        return cattleresumeId;
    }

    public void setCattleresumeId(Long cattleresumeId) {
        this.cattleresumeId = cattleresumeId;
    }

    public Double getWeight() {
        return weight;
    }

    public void setWeight(Double weight) {
        this.weight = weight;
    }

    public String getUploadStatus() {
        return uploadStatus;
    }

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

    public Long getDeptId() {
        return deptId;
    }

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

    public String getSearchValue() {
        return searchValue;
    }

    public void setSearchValue(String searchValue) {
        this.searchValue = searchValue;
    }

    public String getCreateBy() {
        return createBy;
    }

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

    public String getCreateTime() {
        return createTime;
    }

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

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public String toString() {
        return "WeightManEntity{" +
                "unid='" + unid + '\'' +
                ", cattleresumeId='" + cattleresumeId + '\'' +
                ", weight='" + weight + '\'' +
                ", wTime='" + wTime + '\'' +
                ", uploadStatus='" + uploadStatus + '\'' +
                ", deptId='" + deptId + '\'' +
                ", searchValue='" + searchValue + '\'' +
                ", createBy='" + createBy + '\'' +
                ", createTime='" + createTime + '\'' +
                ", updateBy='" + updateBy + '\'' +
                ", updateTime='" + updateTime + '\'' +
                ", remark='" + remark + '\'' +
                '}';
    }

    public String getWTime() {
        return this.wTime;
    }

    public void setWTime(String wTime) {
        this.wTime = wTime;
    }

}
