package com.nantian.cloud.dbcapp.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 com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * <p>
 * 采集配置项生成表
 * </p>
 *
 * @author suixin
 * @since 2022-05-04
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("configure_data_collect_generate")
public class ConfigureDataCollectGenerate extends Model<ConfigureDataCollectGenerate> {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 社会行用统一编码
     */
    @TableField("enterprise_code")
    private String enterpriseCode;

    /**
     * 采集数据项编码
     */
    @TableField("data_code")
    private String dataCode;

    /**
     * 采集数据项指标名称
     */
    @TableField("collect_item_name")
    private String collectItemName;

    /**
     * 生产工序
     */
    @TableField("process_code")
    private String processCode;

    /**
     * 工序名称
     */
    @TableField("process_name")
    private String processName;

    /**
     * 工序单元
     */
    @TableField("process_unit_code")
    private String processUnitCode;

    /**
     * 工序单元名称
     */
    @TableField("process_unit_name")
    private String processUnitName;

    /**
     * 重点用能设备编码
     */
    @TableField("equipment_unit_code")
    private String equipmentUnitCode;

    /**
     * 设备名称
     */
    @TableField("equipment_name")
    private String equipmentName;

    /**
     * 能源分类
     */
    @TableField("energy_class_code")
    private String energyClassCode;

    /**
     * 能源种类
     */
    @TableField("energy_type_code")
    private String energyTypeCode;

    /**
     * 能源用途
     */
    @TableField("data_usage_code")
    private String dataUsageCode;

    /**
     * 数据采集来源
     */
    @TableField("input_type")
    private String inputType;

    /**
     * 数据最大值
     */
    @TableField("data_value_max")
    private BigDecimal dataValueMax;

    /**
     * 数据最小值
     */
    @TableField("data_value_min")
    private BigDecimal dataValueMin;

    /**
     * 数据平均值
     */
    @TableField("data_value_avg")
    private BigDecimal dataValueAvg;

    /**
     * 折标系数最大值
     */
    @TableField("convert_ration_max")
    private BigDecimal convertRationMax;

    /**
     * 折标系数最小值
     */
    @TableField("convert_ration_min")
    private BigDecimal convertRationMin;

    /**
     * 折标系数平均值
     */
    @TableField("convert_ration_avg")
    private BigDecimal convertRationAvg;

    /**
     * 采集频率
     */
    @TableField("stat_type")
    private String statType;

    /**
     * 范围
     */
    @TableField("scope")
    private String scope;

    /**
     * 备注
     */
    @TableField("remark")
    private String remark;

    /**
     * 是否已上传过
     */
    @TableField("uploaded_country")
    private String uploadedCountry;

    /**
     * 摘要
     */
    @TableField("digest")
    private String digest;

    /**
     * 是否参与综合能耗或者单耗计算
     */
    @TableField("is_calculate")
    private String isCalculate;

    /**
     * 创建时间
     */
    @TableField("gmt_create")
    private LocalDateTime gmtCreate;

    /**
     * 更新时间
     */
    @TableField("gmt_modified")
    private LocalDateTime gmtModified;

    /**
     * 采集数据单位
     */
    @TableField("unit")
    private String unit;

    /**
     * 备忘录id
     */
    @TableField("memorandum_id")
    private Long memorandumId;

    /**
     * 备忘录启用日期
     */
    @TableField("memorandum_date")
    private LocalDateTime memorandumDate;

    /**
     * 备忘录状态
     */
    @TableField("memorandum_status")
    private Integer memorandumStatus;

    /**
     * 经验值
     */
    @TableField("experience_value")
    private BigDecimal experienceValue;

    /**
     * 采集配置项映射
     */
    @TableField("data_code_old")
    private String dataCodeOld;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ConfigureDataCollectGenerate that = (ConfigureDataCollectGenerate) o;
        return Objects.equals(id, that.id) && Objects.equals(enterpriseCode, that.enterpriseCode) && Objects.equals(dataCode, that.dataCode) && Objects.equals(collectItemName, that.collectItemName) && Objects.equals(processCode, that.processCode) && Objects.equals(processName, that.processName) && Objects.equals(processUnitCode, that.processUnitCode) && Objects.equals(processUnitName, that.processUnitName) && Objects.equals(equipmentUnitCode, that.equipmentUnitCode) && Objects.equals(equipmentName, that.equipmentName) && Objects.equals(energyClassCode, that.energyClassCode) && Objects.equals(energyTypeCode, that.energyTypeCode) && Objects.equals(dataUsageCode, that.dataUsageCode) && Objects.equals(inputType, that.inputType) && Objects.equals(statType, that.statType) && Objects.equals(digest, that.digest) && Objects.equals(unit, that.unit) && Objects.equals(dataCodeOld, that.dataCodeOld);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, enterpriseCode, dataCode, collectItemName, processCode, processName, processUnitCode, processUnitName, equipmentUnitCode, equipmentName, energyClassCode, energyTypeCode, dataUsageCode, inputType, statType, digest, unit, dataCodeOld);
    }
}
