package com.zksy.pole.domain.po;

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 java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 网关以固定频率上报环境数据
 * @TableName dg_report_environmental_data
 */
@TableName(value ="dg_report_environmental_data")
@Data
public class DgReportEnvironmentalData implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;

    /**
     * cmd
     */
    private Long cmd;

    /**
     * 时间
     */
    private Date dateTime;

    /**
     * 0正常上报,1补传
     */
    private String flag;

    /**
     * 
     */
    private String sersorId;

    /**
     * 监测因子json
     */
    private Object params;

    /**
     * 继电器json
     */
    private Object params2;

    /**
     * 状态json
     */
    private Object params3;

    @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;
        }
        DgReportEnvironmentalData other = (DgReportEnvironmentalData) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCmd() == null ? other.getCmd() == null : this.getCmd().equals(other.getCmd()))
            && (this.getDateTime() == null ? other.getDateTime() == null : this.getDateTime().equals(other.getDateTime()))
            && (this.getFlag() == null ? other.getFlag() == null : this.getFlag().equals(other.getFlag()))
            && (this.getSersorId() == null ? other.getSersorId() == null : this.getSersorId().equals(other.getSersorId()))
            && (this.getParams() == null ? other.getParams() == null : this.getParams().equals(other.getParams()))
            && (this.getParams2() == null ? other.getParams2() == null : this.getParams2().equals(other.getParams2()))
            && (this.getParams3() == null ? other.getParams3() == null : this.getParams3().equals(other.getParams3()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCmd() == null) ? 0 : getCmd().hashCode());
        result = prime * result + ((getDateTime() == null) ? 0 : getDateTime().hashCode());
        result = prime * result + ((getFlag() == null) ? 0 : getFlag().hashCode());
        result = prime * result + ((getSersorId() == null) ? 0 : getSersorId().hashCode());
        result = prime * result + ((getParams() == null) ? 0 : getParams().hashCode());
        result = prime * result + ((getParams2() == null) ? 0 : getParams2().hashCode());
        result = prime * result + ((getParams3() == null) ? 0 : getParams3().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(", cmd=").append(cmd);
        sb.append(", dateTime=").append(dateTime);
        sb.append(", flag=").append(flag);
        sb.append(", sersorId=").append(sersorId);
        sb.append(", params=").append(params);
        sb.append(", params2=").append(params2);
        sb.append(", params3=").append(params3);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}