package com.fuyuanshen.equipment.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
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.fuyuanshen.common.tenant.core.TenantEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * @Description: 设备表
 * @Author: WY
 * @Date: 2025/5/16
 **/
@Data
@TableName("app_device")
public class APPDevice1 extends TenantEntity {

    @TableId(value = "app_device_id", type = IdType.AUTO)
    @Schema(name = "ID")
    private Long id;

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

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

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

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

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

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

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

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

    @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;

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

    /**
     * 租户ID
     */
    @TableField(value = "tenant_id")
    @Schema(hidden = true)
    private String tenantId;

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

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

    /**
     * 绑定类型
     * 0 APP
     * 1 小程序
     */
    @Schema(name = "绑定类型")
    private Integer bindingType;


    public void copy(APPDevice1 source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }


}
