package com.hdkj.lt.bf.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
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 lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@TableName("fhzg_se_monitor_voltage")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class FhzgSeMonitorVoltage implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(type = IdType.AUTO)
    private Long id;
    private String deviceId;
    private String deviceType;
    private String feederId;
    private String feederName;
    private String subsId;
    private String countyId;
    private String mvtransId;
    private String consumerId;
    /** 必须用 IGNORED，否则 updateById 跳过 null → DB 残留旧值 → 状态机误判 */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private LocalDateTime firstOverTime;
    private BigDecimal lastVoltageRatio;
    private Integer lastVoltageStatus;
    private LocalDateTime lastSnapTime;
    private Integer alarmTriggered;
    /** 必须用 IGNORED，同上（null 表示无活跃事件） */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long alarmEventId;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
}
