package digital.laboratory.platform.imr.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import digital.laboratory.platform.common.mybatis.base.BaseEntity;
import lombok.Data;

import java.io.Serializable;

/**
 * 毒品库中的毒品检材信息
 * @TableName b_drug_material_info
 */
@TableName(value ="b_drug_material_info")
@Data
public class DrugMaterialInfo extends BaseEntity {
    /**
     * 主键标识
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 关联的案件id 
     */
    private String caseId;

    /**
     * 毒品检材编号
     */
    private String drugNo;

    /**
     * 毒品检材名称
     */
    private String drugName;

    /**
     * 质量/体积
     */
    private String massVolume;

    /**
     * 质量/体积 单位
     */
    private String unit;

    /**
     * 包装是否完整， 1 完整 | 0 不完整
     */
    private Boolean packageComplete;

    /**
     * 毒品检材状态， 0 录入信息 | 3 待入库 | 5 已入库
     */
    private Integer status;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DrugMaterialInfo other = (DrugMaterialInfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCaseId() == null ? other.getCaseId() == null : this.getCaseId().equals(other.getCaseId()))
            && (this.getDrugNo() == null ? other.getDrugNo() == null : this.getDrugNo().equals(other.getDrugNo()))
            && (this.getDrugName() == null ? other.getDrugName() == null : this.getDrugName().equals(other.getDrugName()))
            && (this.getMassVolume() == null ? other.getMassVolume() == null : this.getMassVolume().equals(other.getMassVolume()))
            && (this.getPackageComplete() == null ? other.getPackageComplete() == null : this.getPackageComplete().equals(other.getPackageComplete()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))
            && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCaseId() == null) ? 0 : getCaseId().hashCode());
        result = prime * result + ((getDrugNo() == null) ? 0 : getDrugNo().hashCode());
        result = prime * result + ((getDrugName() == null) ? 0 : getDrugName().hashCode());
        result = prime * result + ((getMassVolume() == null) ? 0 : getMassVolume().hashCode());
        result = prime * result + ((getPackageComplete() == null) ? 0 : getPackageComplete().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
        result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", caseId=").append(caseId);
        sb.append(", drugNo=").append(drugNo);
        sb.append(", drugName=").append(drugName);
        sb.append(", massVolume=").append(massVolume);
        sb.append(", packageComplete=").append(packageComplete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}