package com.fuyuanshen.equipment.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fuyuanshen.common.tenant.core.TenantEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;

/**
 * @Description: 设备表
 * @Author: WY
 * @Date: 2025/5/16
 **/
@Data
@TableName("device")
@JsonInclude(JsonInclude.Include.ALWAYS)  // 关键注解
public class Device extends TenantEntity {

    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(title = "ID")
    private Long id;

    /**
     * 设备ID
     */
    @TableField(exist = false)
    @Schema(title = "设备ID")
    private Long deviceId;

    @Schema(title = "设备记录ID")
    @TableField(exist = false)
    private Long assignId;

    /**
     * 设备分组
     * group_id
     */
    @Schema(title = "设备分组")
    private Long groupId;

    /**
     * device_type
     */
    @Schema(title = "设备类型")
    private Long deviceType;

    @Schema(title = "设备类型名称")
    private String typeName;

    @Schema(title = "客户号")
    private Long customerId;

    @Schema(title = "所属客户")
    private String customerName;

    /**
     * 当前所有者
     * current_owner_id
     */
    @Schema(title = "当前所有者")
    private Long currentOwnerId;

    /**
     * 原始所有者（创建者）
     * original_owner_id
     */
    @Schema(title = "原始所有者（创建者）")
    private Long originalOwnerId;

    /**
     * 原始设备
     */
    @Schema(title = "原始设备")
    private Long originalDeviceId;

    @Schema(title = "设备编号")
    private String deviceNo;

    @Schema(title = "设备名称")
    private String deviceName;

    @Schema(title = "设备图片")
    private String devicePic;

    @Schema(title = "设备MAC")
    private String deviceMac;

    @Schema(title = "蓝牙名称")
    private String bluetoothName;

    /**
     * 设备IMEI
     * device_imei
     */
    @Schema(title = "设备IMEI")
    private String deviceImei;

    @Schema(title = "设备SN")
    private String deviceSn;

    @Schema(title = "经度")
    private String longitude;

    @Schema(title = "纬度")
    private String latitude;

    @Schema(title = "备注")
    private String remark;

    /**
     * 设备状态
     * 0 失效
     * 1 正常
     */
    @Schema(title = "设备状态")
    private Integer deviceStatus;

    /**
     * 绑定状态
     * 0 未绑定
     * 1 已绑定
     */
    @Schema(title = "绑定状态")
    private Integer bindingStatus;

    /**
     * 创建人名称
     */
    private String createByName;

    private Long bindingUserId;

    /**
     * 绑定时间
     */
    private Date bindingTime;

    private String sendMsg;

    /**
     * 发布主题（格式：A/{device_id}）
     * pub_topic
     */
    private String pubTopic;

    /**
     * 订阅主题（格式：B/{device_id}）
     * sub_topic
     */
    private String subTopic;

    /**
     * 出厂日期
     * production_date
     */
    @Schema(title = "出厂日期")
    private Date productionDate;

    /**
     * 在线状态(0离线，1在线,2异常)
     * online_status
     */
    private Integer onlineStatus;

    /**
     * 高德服务ID
     */
    @Schema(title = "服务ID（高德）")
    private Long sid;
    /**
     * 高德终端ID
     */
    @Schema(title = "终端ID（高德）")
    private Long tid;
    /**
     * 高德轨迹ID
     */
    @Schema(title = "轨迹ID（高德）")
    private Long trid;

}
