package com.fuyuanshen.equipment.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.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(name = "ID")
    private Long id;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * 绑定状态
     * 0 未绑定
     * 1 已绑定
     */
    @Schema(name = "绑定状态")
    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;

}
