package com.ltgk.video.domain.entity;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ltgk.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

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

/**
 * <p>
 * 视频监控管理表
 * </p>
 *
 * @author zhouyaoyao
 * @since 2025-01-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("ds_video")
@ApiModel(value = "DsVideo对象", description = "视频监控管理表")
public class DsVideo extends Model<DsVideo> {

    private static final long serialVersionUID = 1L;

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

    @ApiModelProperty(value = "监控编号")
    @TableField(value = "video_code", condition = SqlCondition.LIKE)
    private String videoCode;

    @ApiModelProperty(value = "监控名称")
    @TableField(value = "video_name", condition = SqlCondition.LIKE)
    private String videoName;

    @ApiModelProperty(value = "监控坐标经度")
    @TableField("longitude")
    private BigDecimal longitude;

    @ApiModelProperty(value = "监控坐标纬度")
    @TableField("latitude")
    private BigDecimal latitude;

    @ApiModelProperty(value = "监控安装高度（米）")
    @TableField("height")
    private BigDecimal height;

    @ApiModelProperty(value = "可视距离（公里）")
    @TableField("vision_distance")
    private BigDecimal visionDistance;

    @ApiModelProperty(value = "设备ip")
    @TableField("video_ip")
    private String videoIp;

    @ApiModelProperty(value = "设备端口号")
    @TableField("video_port")
    private String videoPort;

    @ApiModelProperty(value = "设备账号")
    @TableField("video_account")
    private String videoAccount;

    @ApiModelProperty(value = "设备密码")
    @TableField("video_password")
    private String videoPassword;

    @ApiModelProperty(value = "通道号")
    @TableField("channel_no")
    private String channelNo;

    @ApiModelProperty(value = "所属渔港")
    @TableField(value = "belong_port", condition = SqlCondition.LIKE)
    private String belongPort;

    @ApiModelProperty(value = "监控类型（球机、云台）")
    @TableField("video_type")
    private String videoType;

    @ApiModelProperty(value = "镜头传感器类型（可见光、热成像）")
    @TableField("sensor_type")
    private String sensorType;

    @ApiModelProperty(value = "监管所属单位")
    @TableField(value = "belong_unit", condition = SqlCondition.LIKE)
    private String belongUnit;

    @ApiModelProperty(value = "运行状态")
    @TableField("run_status")
    private String runStatus;

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

    @ApiModelProperty(value = "创建时间")
    @TableField("create_at")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createAt;

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

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

    @ApiModelProperty(value = "编辑人")
    @TableField("update_by")
    private String updateBy;

    @ApiModelProperty(value = "报警划线坐标")
    @TableField("line_point")
    private String linePoint;

    @ApiModelProperty(value = "视频预览链接")
    @TableField("video_url")
    private String videoUrl;

    @ApiModelProperty(value = "是否智能识别渔船")
    @TableField("is_analysis_boat")
    private String isAnalysisBoat;

    @ApiModelProperty(value = "删除标记")
    @TableField("del_flag")
    @TableLogic(delval = "1", value = "0")
    @JsonIgnore
    private Integer delFlag;

    @ApiModelProperty(value = "行政区域编码")
    @Excel(name = "行政区域名称", required = true)
    private String areaCode;

    @ApiModelProperty(value = "行政区域名称")
    @Excel(name = "行政区域名称", required = true)
    private String areaName;
    /**
     * 页容量
     */
    @TableField(exist = false)
    @JsonIgnore
    private Integer pageSize;

    /**
     * 页码
     */
    @TableField(exist = false)
    @JsonIgnore
    private Integer pageNum;

    /**
     * 热成像设备最大变倍参数
     */
    @ApiModelProperty("热成像设备最大变倍参数")
    private Double zRcxVal;

    /**
     * 俯仰角调节参数
     */
    @ApiModelProperty("俯仰角调节参数")
    private Double yVal;
    private String yValArr;

    /**
     * 水平旋转调节参数
     */
    @ApiModelProperty("水平旋转调节参数")
    private Double xVal;
    private String xValArr;

    /**
     * 距离与变倍参数换算参数
     */
    @ApiModelProperty("距离与变倍参数换算参数")
    private Double zNumVal;
    private String zNumValArr;

    /**
     * 水平遮挡方位角区间
     */
    @ApiModelProperty("水平遮挡方位角区间")
    private String xRotateVal;

    /**
     * 可见光设备变倍最大参数
     */
    @ApiModelProperty("可见光设备变倍最大参数")
    private Double zMaxVal;

    /**
     * 监控顺逆时针旋转参数 -1: 旋转角度大于零，顺时针右侧旋转 旋转角度小于零，逆时针左侧旋转；1: 旋转角度大于零，逆时针右侧旋转 旋转角度小于零，顺时针左侧旋转
     */
    private Integer rotateT;

    /**
     * 监控设备与联动目标的实际距离
     */
    @TableField(exist = false)
    private BigDecimal distance;
    /**
     * 监控设备与联动目标的距离（对比可视距离后）
     */
    @TableField(exist = false)
    private double distanceVal;
    /**
     * 监控设备与联动目标的距离（对比遮挡范围后）
     */
    @TableField(exist = false)
    private BigDecimal distance1;

    @ApiModelProperty(value = "是否卡口；1-是，0-否")
    @TableField("be_bayonet")
    private Integer beBayonet;

    @ApiModelProperty(value = "是否锁定；1-是，0-否")
    @TableField("be_lock")
    private Integer beLock;

    @TableField(exist = false)
    private JSONObject PTZCfg;

    @ApiModelProperty(value = "是否开启可视范围；1-是，0-否")
    @TableField(value = "whether_to_turn_on_the_view")
    private Integer whetherToTurnOnTheView;
}
