package com.zc.business.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ruoyi.common.annotation.Excel;
import com.zc.business.utils.StakeMarkUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@Data
@ApiModel(value = "DcDevice", description = "设备实体")
public class DcDevice {

    public static final Integer UNUSEDSTATE = 0;
    public static final Integer USEOFSTATE = 1;

    // 异常的
    public static final String ABNORMAL = "0";
    // 正常的
    public static final String NORMAL = "1";

    // 离线状态
    public static final String OFFLINE = "0";
    // 在线状态
    public static final String ONLINE = "1";

    @ApiModelProperty("ID")
    @Excel(name = "设备ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @ApiModelProperty("物联设备ID")
    @Excel(name = "物联设备ID")
    private String iotDeviceId;
    @ApiModelProperty("组ID")
    @Excel(name = "组ID")
    private Long groupId;
    @ApiModelProperty("产品ID")
    @Excel(name = "产品ID")
    private Long productId;
    @ApiModelProperty("桩号")
    @Excel(name = "桩号")
    private String stakeMark;
    @ApiModelProperty("方向1-上行(菏泽方向),2-中,3-下行(济南方向)")
    @Excel(name = "方向")
    private String direction;
    @ApiModelProperty("设备名称")
    @Excel(name = "设备名称")
    private String deviceName;
    @ApiModelProperty("设备编号")
    @Excel(name = "设备编号")
    private String deviceCode;
    @ApiModelProperty("设备类型")
    @Excel(name = "设备类型")
    private String deviceType;
    @ApiModelProperty("所属网段")
    @Excel(name = "所属网段")
    private String networkSegment;
    @ApiModelProperty("设备图片")
    @Excel(name = "设备图片")
    private String deviceImg;
    @ApiModelProperty("安装日期")
    @Excel(name = "安装日期")
    private Date installationDate;
    @ApiModelProperty("生产日期")
    @Excel(name = "生产日期")
    private Date productionDate;
    @ApiModelProperty("使用年限")
    @Excel(name = "使用年限")
    private String durableYears;
    @ApiModelProperty("安装位置")
    @Excel(name = "安装位置")
    private String installationSite;
    @ApiModelProperty("设备状态")
    @Excel(name = "设备状态")
    private String deviceState;
    @ApiModelProperty("使用状态")
    @Excel(name = "使用状态")
    private Integer useState;
    @ApiModelProperty("其他配置")
    @Excel(name = "其他配置")
    private String otherConfig;
    @ApiModelProperty("备注")
    @Excel(name = "备注")
    private String remark;
    @ApiModelProperty("设施归属类型(0:默认1: 道路沿线2:桥梁3: 隧道4:收费广场5: 收费站6: 服务区等")
    @Excel(name = "设施归属类型")
    private String facilitiesType;
    @ApiModelProperty("设备ip")
    @Excel(name = "设备ip")
    private String deviceIp;
    @ApiModelProperty("范围桩号")
    @Excel(name = "范围桩号")
    private String stakeMarkRange;
    @ApiModelProperty("创建时间")
    @Excel(name = "创建时间")
    private Date createTime;
    @ApiModelProperty("修改时间")
    @Excel(name = "修改时间")
    private Date updateTime;
    @ApiModelProperty("子类型")
    @Excel(name = "子类型")
    private String childType;
    @TableField(exist = false)
    private String longitude;
    @TableField(exist = false)
    private String sumAll;
    @TableField(exist = false)
    private String latitude;
    //设备厂商
    @TableField(exist = false)
    private String manufacturer;

    public Integer stakeMarkToInt() {
        return StakeMarkUtils.stakeMarkToInt(stakeMark);
    }
}