/*
 * Author: wangjian
 * 生成entity
 */
package com.tofly.pojo.emergency;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.tofly.mybatisplus.config.ToflySqlCondition;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;


import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.stream.Collectors;


/**
 * 应急事件记录表
 *
 * @author admin
 * @date Tue Feb 22 00:00:00 CST 2022
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "TF_YWPN_EMERGENCY_W", resultMap = "emergencyMap")
@KeySequence("TF_YWPN_EMERGENCY_W")
@ApiModel
public class Emergency extends Model<Emergency> {
    private static final long serialVersionUID = 1L;

    /**
     * $column.comments
     */
    @TableId(value = "ID", type = IdType.INPUT)
    @ApiModelProperty(value = "$column.comments")
    private Long id;
    /**
     * 事件编码(按照部门名称加时间生成)
     */
    @ApiModelProperty(value = "事件编码(按照部门名称加时间生成)")
    private String code;
    /**
     * 事件名称
     */
    @ApiModelProperty(value = "事件名称")
    @NotNull(message = "事件名称不能为空")
    @TableField(condition=ToflySqlCondition.LIKE)
    private String name;
    /**
     * 事件类型 关联表TF_YWPN_EMERGENCY_TYPE_W id
     */
    @ApiModelProperty(value = "事件类型 关联表TF_YWPN_EMERGENCY_TYPE_W id")
    @NotNull(message = "事件类型")
    private Long typeId;
    @TableField(exist = false)
    private String typeName;
    /**
     * 事件地址
     */
    @ApiModelProperty(value = "事件地址")
    @NotNull(message = "事件地点不能为空")
    @TableField(condition=ToflySqlCondition.LIKE)
    private String address;
    /**
     * 事件描述
     */
    @ApiModelProperty(value = "事件描述")
    private String note;
    /**
     * 发现人员
     */
    @ApiModelProperty(value = "发现人员")
    private Long foundUserId;
    @TableField(exist = false)
    private String foundUserName;
    /**
     * 发现时间
     */
    @ApiModelProperty(value = "发现时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date foundTime;
    /**
     * 是否派工(0不派工1派工)
     */
    @ApiModelProperty(value = "是否派工(0不派工1派工)")
    private String isDispatching;
    @TableField(exist = false)
    private String isDispatchingName;
    /**
     * 联系电话
     */
    @ApiModelProperty(value = "联系电话")
    private String foundPhone;
    /**
     * 处理人员
     */
    @ApiModelProperty(value = "处理人员")
    private Long disUserId;
    @TableField(exist = false)
    private String disUserName;
    /**
     * 协同处理人,多个以,分隔
     */
    @ApiModelProperty(value = "协同处理人,多个以,分隔")
    private String synergyUserIds;

    @TableField(exist = false)
    private String synergyUserNames;
    /**
     * 是否发送短信(0不1是)
     */
    @ApiModelProperty(value = "是否发送短信(0不1是)")
    private String isMessage;
    @TableField(exist = false)
    private String isMessageName;
    /**
     * 消息内容
     */
    @ApiModelProperty(value = "消息内容")
    private String messageNote;
    /**
     * 应急状态(0未上报,1派工上报,2已派工 3待审核 4已完成)
     */
    @ApiModelProperty(value = "应急状态(0未上报,1派工上报,2已派工 3待审核 4已完成)")
    private String state;
    @TableField(exist = false)
    private String stateName;
    /**
     * 派工人id
     */
    @ApiModelProperty(value = "派工人id")
    private Long dispatchingUserId;
    @TableField(exist = false)
    private String dispatchingUserName;

    /**
     * 派工时间
     */
    @ApiModelProperty(value = "派工时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date dispatchingTime;

    @ApiModelProperty(value = "文件id列表,多个以,分隔")
    private String fileIds;
    @ApiModelProperty(value = "文件路径列表")
    @TableField(exist = false)
    List<String> fileIdsList;

    @ApiModelProperty(value = "经度")
    private BigDecimal x;
    /**
     * 维度
     */
    @ApiModelProperty(value = "维度")
    private BigDecimal y;

    @ApiModelProperty(value = "处理人电话")
    private String disPhone;

    @ApiModelProperty(value = "应急处理记录列表")
    @TableField(exist = false)
    private List<EmergencyDis> emergencyDisList;
}
