package com.tofly.scada.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author haiqiu
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "SCADA_HISTORY",resultMap = "scadaHisMap")
@KeySequence("SCADA_HISTORY")
@ApiModel
public class Scada extends Model<Scada> {
    private static final long serialVersionUID = 1L;

    @TableId(value = "ID", type = IdType.INPUT)
    @ApiModelProperty(value = "ID")
    private Long id;

    @ApiModelProperty(value = "指标编码")
    private String code;

    @ApiModelProperty(value = "指标值")
    private String value;

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


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

    @ApiModelProperty(value = "指标采集时间字符")
    @TableField(exist = false)
    private String scadaTimeStr;
}
