package com.tofly.scada.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 com.fasterxml.jackson.annotation.JsonFormat;
import com.tofly.mybatisplus.config.ToflySqlCondition;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.codehaus.jackson.map.ser.std.ToStringSerializer;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 报警数据存储(TfScadaReportList)表实体类
 *
 * @author HaiQiu
 * @since 2022-09-21 16:43:17
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName(value = "TF_SCADA_REPORT_LIST", resultMap = "TfScadaReportListMap")
@ApiModel(value = "TfScadaReportList对象", description = "报警数据存储")
public class TfScadaReportList extends Model<TfScadaReportList> {

    private static final long serialVersionUID = 767784056650653123L;

    /**
     * ID
     */
    @ApiModelProperty(value = "ID")
    @TableId(type = IdType.ASSIGN_ID)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

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

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

    /**
     * 指标采集时间
     */
    @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;

    /**
     * 报警等级
     */
    @ApiModelProperty(value = "报警等级")
    private String reportLevel;

    /**
     * 报警上限
     */
    @ApiModelProperty(value = "报警上限")
    private String reportUpper;

    /**
     * 报警下限
     */
    @ApiModelProperty(value = "报警下限")
    private String reportLower;

    /**
     * 状态：0：未处理，1：已处理）
     */
    @ApiModelProperty(value = "状态：0：未处理，1：已处理）")
    private String status;


    /**
     * 指标中文名称
     */
    @ApiModelProperty(value = "指标中文名称 ")
    @TableField(condition = ToflySqlCondition.LIKE)
    private String displayName;

    /**
     * 查询开始时间
     */
    @ApiModelProperty(value = "查询开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false)
    private Date start;

    /**
     * 查询结束时间
     */
    @ApiModelProperty(value = "查询结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false)
    private Date end;

    /**
     * 查询多个指标编码,用英文逗号分隔开
     */
    @ApiModelProperty(value = "查询多个指标编码,用英文逗号分隔开")
    @TableField(exist = false)
    private String codes;

    /**
     * 查询处理状态：0：未处理，1：已处理）
     */
    @ApiModelProperty(value = "查询处理状态：0：未处理，1：已处理）")
    @TableField(exist = false)
    private String dealStatus;

    /**
     * 指标单位
     */
    @ApiModelProperty(value = "指标单位")
    @TableField(exist = false)
    private String reportUnit;


    @ApiModelProperty(value = "报警内容")
    private String reportContent;

    @ApiModelProperty(value = "报警处理时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date dealDate;

    @ApiModelProperty(value = "报警处理人Id")
    private Long dealUserId;

    @ApiModelProperty(value = "报警处理人")
    private String dealUserName;


    @ApiModelProperty(value = "报警处理备注")
    private String dealRemark;

    @ApiModelProperty(value = "是否查询自己可以处理的数据,0 否，1 是")
    @TableField(exist = false)
    private Integer searchOwn;
}

