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;

/**
 * 配种记录主对象 zxgl_cattlemating_master
 *
 * @author phlx
 * @date 2022-01-10
 */
@Entity
public class BreedingRecordEntity extends BaseObservable implements Parcelable {

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

    /**
     * 母畜耳标号
     */
    private Long cattleresumeId;

    /**
     * 饲养品种（利木赞;西门塔尔等）
     */
    private String raiseVarieties;

    /**
     * 所在地
     */
    private String location;

    /**
     * 所属种畜站
     */
    private String breedingPlantId;

    /** 是否上传 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 BreedingRecordEntity() {
    }

    protected BreedingRecordEntity(Parcel in) {
        if (in.readByte() == 0) {
            unid = null;
        } else {
            unid = in.readLong();
        }
        if (in.readByte() == 0) {
            cattleresumeId = null;
        } else {
            cattleresumeId = in.readLong();
        }
        raiseVarieties = in.readString();
        location = in.readString();
        breedingPlantId = 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 = 879600834)
    public BreedingRecordEntity(Long unid, Long cattleresumeId, String raiseVarieties, String location,
            String breedingPlantId, String uploadStatus, Long deptId, String searchValue,
            String createBy, String createTime, String updateBy, String updateTime, String remark) {
        this.unid = unid;
        this.cattleresumeId = cattleresumeId;
        this.raiseVarieties = raiseVarieties;
        this.location = location;
        this.breedingPlantId = breedingPlantId;
        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);
        }
        dest.writeString(raiseVarieties);
        dest.writeString(location);
        dest.writeString(breedingPlantId);
        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<BreedingRecordEntity> CREATOR = new Creator<BreedingRecordEntity>() {
        @Override
        public BreedingRecordEntity createFromParcel(Parcel in) {
            return new BreedingRecordEntity(in);
        }

        @Override
        public BreedingRecordEntity[] newArray(int size) {
            return new BreedingRecordEntity[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 String getRaiseVarieties() {
        return raiseVarieties;
    }

    public void setRaiseVarieties(String raiseVarieties) {
        this.raiseVarieties = raiseVarieties;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getBreedingPlantId() {
        return breedingPlantId;
    }

    public void setBreedingPlantId(String breedingPlantId) {
        this.breedingPlantId = breedingPlantId;
    }

    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 "BreedingRecordEntity{" +
                "unid='" + unid + '\'' +
                ", cattleresumeId='" + cattleresumeId + '\'' +
                ", raiseVarieties='" + raiseVarieties + '\'' +
                ", location='" + location + '\'' +
                ", breedingPlantId='" + breedingPlantId + '\'' +
                ", uploadStatus='" + uploadStatus + '\'' +
                ", deptId='" + deptId + '\'' +
                ", searchValue='" + searchValue + '\'' +
                ", createBy='" + createBy + '\'' +
                ", createTime='" + createTime + '\'' +
                ", updateBy='" + updateBy + '\'' +
                ", updateTime='" + updateTime + '\'' +
                ", remark='" + remark + '\'' +
                '}';
    }
}
