package com.hdkj.lt.bf.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.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 告警事件实体
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("t_alarm_event")
@ApiModel(description = "告警事件")
public class AlarmEvent implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键ID")
    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "批次ID")
    private String batchId;

    @ApiModelProperty(value = "区县ID")
    private String countyId;

    @ApiModelProperty(value = "区县SID")
    private String countySid;

    @ApiModelProperty(value = "区县名称")
    private String countyName;

    @ApiModelProperty(value = "馈线ID")
    private String feederId;

    @ApiModelProperty(value = "告警类型")
    private String alarmTypes;

    @ApiModelProperty(value = "最大负载率(%)")
    private BigDecimal maxLoadRatePct;

    @ApiModelProperty(value = "最大电压(pu)")
    private BigDecimal maxVoltagePu;

    @ApiModelProperty(value = "最小电压(pu)")
    private BigDecimal minVoltagePu;

    @ApiModelProperty(value = "指标结果ID")
    private Long indicatorResultId;

    @ApiModelProperty(value = "告警次数")
    private Integer alarmCount;

    @ApiModelProperty(value = "告警日期")
    private LocalDate alarmDate;

    @ApiModelProperty(value = "告警时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime alarmTime;

    @ApiModelProperty(value = "最后告警时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastAlarmTime;

    @ApiModelProperty(value = "状态")
    private Integer status;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    /**
     * 馈线名称（联表查询，非数据库字段）
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "馈线名称")
    private String feederName;

    /**
     * 健康度（联表查询，非数据库字段）
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "健康度")
    private String healthScore;
}
