package com.ltgk.boat.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ltgk.boat.domain.vo.RadarWakeVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 船舶报警表（主表，报警基本信息）
 */
@ApiModel(description = "船舶报警表（主表，报警基本信息）")
@Data
@TableName(value = "boat_alarm_info")
@Accessors(chain = true)
public class BoatAlarmInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "")
    private String id;

    @TableField(value = "alarm_type")
    @ApiModelProperty(value = "报警类型")
    private String alarmType;

    @TableField(value = "alarm_nature")
    @ApiModelProperty(value = "报警种类，（1是安全报警，2是违规报警）")
    private String alarmNature;

    @TableField(value = "alarm_area")
    @ApiModelProperty(value = "报警区域（涉外报警，或者警戒区，电子围栏报警区域信息）")
    private String alarmArea;

    @TableField(value = "mmsi")
    @ApiModelProperty(value = "通导设备号")
    private String mmsi;

    @TableField(value = "target_source_id", condition = SqlCondition.LIKE)
    @ApiModelProperty(value = "目标源id 目标在设备端的唯一标识 -- 雷达数据使用")
    private String targetSourceId;

    @TableField(value = "area_code")
    @ApiModelProperty(value = "渔船所在区域编码")
    private String areaCode;

    @TableField(value = "boat_name")
    @ApiModelProperty(value = "船名")
    private String boatName;

    @TableField(value = "area_number")
    @ApiModelProperty(value = "所在海区信息")
    private String areaNumber;

    @TableField(value = "last_longitude")
    @ApiModelProperty(value = "渔船最后一次出现经度")
    private String lastLongitude;

    @TableField(value = "last_latitude")
    @ApiModelProperty(value = "渔船最后一次出现纬度")
    private String lastLatitude;

    @TableField(value = "last_location_time")
    @ApiModelProperty(value = "渔船最后一次定位时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastLocationTime;

    @TableField(value = "last_bwlx")
    @ApiModelProperty(value = "最后报文类型")
    private String lastBwlx;

    @TableField(value = "speed")
    @ApiModelProperty(value = "航速")
    private String speed;

    @TableField(value = "course")
    @ApiModelProperty(value = "航向")
    private String course;

    @TableField(value = "alarm_time")
    @ApiModelProperty(value = "报警时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date alarmTime;

    @TableField(value = "accept_state")
    @ApiModelProperty(value = "受理状态(0为待受理，1为处理中，2为已处理，3为标记结束)")
    private Integer acceptState;

    @TableField(value = "img_url")
    @ApiModelProperty(value = "报警图片url")
    private String imgUrl;

    @TableField(value = "img_time")
    @ApiModelProperty(value = "拍照时间")
    private Date imgTime;

    @TableField(value = "video_url")
    @ApiModelProperty(value = "报警视频url")
    private String videoUrl;

    @TableField(value = "create_by")
    @ApiModelProperty(value = "创建人账号")
    private String createBy;

    @TableField(value = "create_at")
    @ApiModelProperty(value = "创建时间")
    private Date createAt;

    @TableField(value = "update_by")
    @ApiModelProperty(value = "最后更新人")
    private String updateBy;

    @TableField(value = "update_at")
    @ApiModelProperty(value = "最新更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateAt;

    @TableField(value = "del_flag")
    @ApiModelProperty(value = "删除标志：0：未删除；1：已删除")
    @TableLogic(delval = "1", value = "0")
    private Integer delFlag;

    @TableField(value = "accept_user_id")
    @JsonProperty(value = "acceptUserId")
    @ApiModelProperty(value = "受理人主键")
    private String acceptUserId;

    @TableField(value = "accept_user_name")
    @JsonProperty(value = "acceptUserName")
    @ApiModelProperty(value = "受理人名称")
    private String acceptUserName;

    @TableField(value = "accept_time")
    @JsonProperty(value = "acceptTime")
    @ApiModelProperty(value = "受理时间")
    private Date acceptTime;

    @TableField(value = "verify_situation")
    @JsonProperty(value = "verifySituation")
    @ApiModelProperty(value = "核实情况")
    private String verifySituation;

    @TableField(value = "participants")
    @JsonProperty(value = "participants")
    @ApiModelProperty(value = "参与人员")
    private String participants;

    @TableField(value = "process_results")
    @JsonProperty(value = "processResults")
    @ApiModelProperty(value = "处理结果")
    private String processResults;

    @TableField(value = "process_user_name")
    @JsonProperty(value = "processUserName")
    @ApiModelProperty(value = "处理人员名称")
    private String processUserName;

    @TableField(value = "process_user_id")
    @JsonProperty(value = "processUserId")
    @ApiModelProperty(value = "处理人员主键")
    private String processUserId;

    @ApiModelProperty("长度 目标长度，单位：米(m)")
    @TableField(value = "length")
    public Double length;

    @TableField(value = "remark")
    @JsonProperty(value = "remark")
    @ApiModelProperty(value = "备注")
    private String remark;

    @TableField(exist = false)
    @JsonProperty(value = "wakeVoList")
    @ApiModelProperty(value = "疑似三无船只尾迹")
    private List<RadarWakeVo> wakeVoList;

    @TableField(exist = false)
    @JsonProperty(value = "boatAlarmInfoIdList")
    @ApiModelProperty(value = "告警表主键列表")
    private List<String> boatAlarmInfoIdList;
}