package com.zksy.drainage.domain;

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.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 排水预警信息
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "early_warning", schema = "app_user")
public class DrainageWarning {

    @TableId(value = "warning_id", type = IdType.ASSIGN_UUID)
    @ApiModelProperty("主键ID")
    private String id;

    @ApiModelProperty("预警编号")
    private String warningNo;

    @ApiModelProperty("关联设备ID")
    @TableField(exist = false)
    private String equipmentId;

    @ApiModelProperty("设备名称")
    @TableField("warning_name")
    private String equipmentName;

    @ApiModelProperty("预警级别(1严重,2重要,3一般)")
    private Integer warningLevel;

    @ApiModelProperty("预警类型")
    private String warningType;

    @ApiModelProperty("预警专项")
    private String warningSpecial;

    @ApiModelProperty("当前监测值")
    @TableField(exist = false)
    private String currentValue;

    @ApiModelProperty("阈值")
    @TableField(exist = false)
    private String thresholdValue;

    @ApiModelProperty("预警位置")
    private String location;

    @ApiModelProperty("经度")
    private BigDecimal longitude;

    @ApiModelProperty("纬度")
    private BigDecimal latitude;

    @ApiModelProperty("预警内容")
    @TableField("warning_content")
    private String content;

    @ApiModelProperty("预警发生时间")
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime warningTime;

    @ApiModelProperty("发布人")
    private String publisher;

    @ApiModelProperty("发布时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime publishTime;

    @ApiModelProperty("发布范围(2相关部门,3指定人员)")
    @TableField(exist = false)
    private Integer publishScope;

    @ApiModelProperty("发布范围部门ID(publish_scope=2时存储排水单位部门ID)")
    @TableField(exist = false)
    private Long scopeDeptId;

    @ApiModelProperty("状态(DRAFT草稿,PENDING待办,PROCESSING处置中,RELEASED已发布,HANDLED已处置,CLOSED已解除)")
    private String status;

    @ApiModelProperty("处理人ID")
    @TableField(exist = false)
    private Long firstApprover;

    @ApiModelProperty("处理人名称")
    @TableField(exist = false)
    private String firstApproverName;

    @ApiModelProperty("处理时间")
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime firstApproveTime;

    @ApiModelProperty("审批人ID(管理员)")
    @TableField(exist = false)
    private Long finalApprover;

    @ApiModelProperty("审批人名称")
    @TableField(exist = false)
    private String finalApproverName;

    @ApiModelProperty("审批时间")
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime finalApproveTime;

    @ApiModelProperty("处理时间")
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime processTime;

    @ApiModelProperty("处理人")
    @TableField("handler")
    private String processor;

    @ApiModelProperty("备注")
    private String remark;

    @TableField(exist = false)
    @ApiModelProperty("删除标志(0正常,1删除)")
    private String delFlag;

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

    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;
}
