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;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 毒品库中关联的案事件信息
 * @TableName b_drug_case_info
 */
@TableName(value ="b_drug_case_info")
@Data
public class DrugCaseInfo extends BaseEntity{
    /**
     * 主键标识
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 案事件名称
     */
    private String caseName;

    /**
     * 案件编号
     */
    private String caseNo;

    /**
     * 送缴单位
     */
    private String handingOverOrg;

    /**
     * 送缴日期
     */
    private LocalDate handingOverDate;

    /**
     * 前端需要展示的机构组件，保存了送缴单位的父级机构id和自己机构id
     */
    private String frontOrgIds;

    @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;
        }
        DrugCaseInfo other = (DrugCaseInfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCaseName() == null ? other.getCaseName() == null : this.getCaseName().equals(other.getCaseName()))
            && (this.getCaseNo() == null ? other.getCaseNo() == null : this.getCaseNo().equals(other.getCaseNo()))
            && (this.getHandingOverOrg() == null ? other.getHandingOverOrg() == null : this.getHandingOverOrg().equals(other.getHandingOverOrg()))
            && (this.getHandingOverDate() == null ? other.getHandingOverDate() == null : this.getHandingOverDate().equals(other.getHandingOverDate()))
            && (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 + ((getCaseName() == null) ? 0 : getCaseName().hashCode());
        result = prime * result + ((getCaseNo() == null) ? 0 : getCaseNo().hashCode());
        result = prime * result + ((getHandingOverOrg() == null) ? 0 : getHandingOverOrg().hashCode());
        result = prime * result + ((getHandingOverDate() == null) ? 0 : getHandingOverDate().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(", caseName=").append(caseName);
        sb.append(", caseNo=").append(caseNo);
        sb.append(", handingOverOrg=").append(handingOverOrg);
        sb.append(", handingOverDate=").append(handingOverDate);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}