package com.ruoyi.energymeter.pojo; import com.baomidou.mybatisplus.annotation.FieldFill; 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.v3.oas.annotations.media.Schema; import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; /** * 水电表本地绑定档案。 */ @Data @TableName("energy_meter_device") @Schema(description = "水电表绑定设备") public class EnergyMeterDevice implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Long id; @Schema(description = "租户ID") @TableField(fill = FieldFill.INSERT) private Long tenantId; @Schema(description = "能源类型 WATER/ELECTRIC/GAS") private String meterType; @Schema(description = "数据来源 PROVIDER第三方接入/MANUAL手工抄表") private String sourceType; @Schema(description = "第三方通信地址或表号,保留前导零") private String meterAddress; @Schema(description = "第三方设备ID") private String providerMeterId; @Schema(description = "第三方设备名称") private String providerName; @Schema(description = "本系统显示名称") private String displayName; @Schema(description = "第三方区域ID") private Long providerAreaId; @Schema(description = "第三方区域名称") private String providerAreaName; @Schema(description = "第三方总表ID") private String parentProviderId; @Schema(description = "本地总表ID") private Long parentMeterId; @Schema(description = "安装位置") private String location; @Schema(description = "在线状态 1在线 0离线") private Integer onlineStatus; @Schema(description = "绑定状态 VERIFIED/INVALID") private String bindStatus; @Schema(description = "是否启用 1启用 0停用") private Integer enabled; @Schema(description = "是否初始化设备 1是(禁止删除)0否") private Integer isSeed; @Schema(description = "是否演示数据 1是(每日同步时生成模拟用量)0否") private Integer simulated; @Schema(description = "手工抄表起始表码") private BigDecimal initialReading; @Schema(description = "手工抄表起始表码日期") @JsonFormat(pattern = "yyyy-MM-dd") private LocalDate initialReadingDate; @Schema(description = "最早需要同步的业务日期") @JsonFormat(pattern = "yyyy-MM-dd") private LocalDate syncStartDate; @Schema(description = "最近成功采集时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime lastSuccessAt; @Schema(description = "最近采集错误类别") private String lastErrorCode; @Schema(description = "最近采集错误摘要") private String lastErrorMessage; @TableField(fill = FieldFill.INSERT) private Long createUser; @TableField(fill = FieldFill.INSERT) @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime createTime; @TableField(fill = FieldFill.INSERT_UPDATE) private Long updateUser; @TableField(fill = FieldFill.INSERT_UPDATE) @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime updateTime; /* ---------------- 列表展示用非持久化字段 ---------------- */ @Schema(description = "最近一次任务状态") @TableField(exist = false) private String lastTaskStatus; @Schema(description = "最近一次任务时间") @TableField(exist = false) @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime lastTaskTime; @Schema(description = "最近一天用量") @TableField(exist = false) private BigDecimal lastDayUsage; @Schema(description = "最新表码读数") @TableField(exist = false) private BigDecimal latestReading; @Schema(description = "上期表码读数") @TableField(exist = false) private BigDecimal previousReading; @Schema(description = "最近一天用量的业务日期") @TableField(exist = false) @JsonFormat(pattern = "yyyy-MM-dd") private LocalDate lastDayUsageDate; @Schema(description = "采集状态说明") @TableField(exist = false) private String collectStateText; @Schema(description = "能源类型中文名") @TableField(exist = false) private String meterTypeName; @Schema(description = "数据来源中文名") @TableField(exist = false) private String sourceTypeName; @Schema(description = "指标单位") @TableField(exist = false) private String unit; @Schema(description = "是否允许删除") @TableField(exist = false) private Boolean deletable; }