package com.tofly.scada.entity.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tofly.scada.entity.ScadaReport;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 
 * @TableName STATISTICS_SCADA
 */
@Data
@EqualsAndHashCode
public class StatisticsScadaVo implements Serializable {
    /**
     * 主键ID
     */
    @TableId(value = "ID", type = IdType.INPUT)
    private Long id;

    /**
     * 指标编码
     */
    private String code;

    /**
     * 指标值
     */
    private String value;

    /**
     * 统计类型：0小时统计 1天统计 2月统计 3年统计
     */
    private Integer statisticsType;

    @ApiModelProperty(value = "指标采集时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date scadaTime;

    @ApiModelProperty(value = "指标更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 统计开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    /**
     * 统计结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    /**
     * 最大值
     */
    private Double max;

    /**
     * 最小值
     */
    private Double min;

    /**
     * 平均值
     */
    private Double ave;

    /**
     * 叠加值
     */
    private Double fold;

    /**
     * 指标类型：与指标编码表里面的 绑定码表里面维护  转义
     */
    private String dataType;

    /**
     * 合格率
     */
    private Float pass;

    /**
     * 超标次数
     */
    private Integer errorCount;

    /**
     * 不合格超标时长
     */
    private Long errorTimeTotal;

    /**
     * 超标总时长
     */
    private Long timeTotal;

    @ApiModelProperty(value = "设备名称")
    private String name;

    @ApiModelProperty(value = "制造日期")
    private String makeDate;

    @ApiModelProperty(value = "设备类型")
    private String type;

    @ApiModelProperty(value = "制造厂家")
    private String manufacturer;

    @ApiModelProperty(value = "负责人")
    private String leader;

    @ApiModelProperty(value = "联系电话")
    private String phone;

    @ApiModelProperty(value = "显示名称")
    private String displayName;

    @ApiModelProperty(value = "变量名称")
    private String variableName;

    @ApiModelProperty(value = "单位")
    private String unit;

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "绑定的子历史数据")
    List<ScadaVo> scadaVos;

    @ApiModelProperty(value = "报警绑定列表")
    private List<ScadaReport> scadaReports;

}