#创建物联网设备模块的三层架构代码+库表的创建(新增几个了)

This commit is contained in:
2026-05-09 15:01:49 +08:00
parent 038006a212
commit a8bdcad183
5 changed files with 104 additions and 22 deletions

View File

@@ -16,25 +16,27 @@ import java.util.List;
import java.util.Map;
/**
* 除了割草机器人之外的设备 包含其他的物联设备
*
* @author rqian
* @date 2026-3-11
* 通用设备表(除割草机器人外的其他物联设备)
*/
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("iot_device_common")
@TableName(value = "iot_device_common", autoResultMap = true)
public class IoTCommonDevice extends BaseDO {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
private Long id;
/**
* 设备ID
* 平台设备 ID
*/
private String deviceId;
/**
* 设备 SN(硬件序列号)
*/
private String sn;
/**
* 设备名称
*/
@@ -66,10 +68,25 @@ public class IoTCommonDevice extends BaseDO {
private String networkAddress;
/**
* 设备入网IP
* 设备入网 IP
*/
private String networkIp;
/**
* 设备端口
*/
private Integer port;
/**
* 登录账号
*/
private String username;
/**
* 登录密码
*/
private String password;
/**
* 设备经度
*/
@@ -83,23 +100,23 @@ public class IoTCommonDevice extends BaseDO {
/**
* 激活时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date activeTime;
/**
* 物模型值
* 物模型值(非数据库字段)
*/
@TableField(exist = false)
private Map<String, Object> properties;
/**
* 设备备注
**/
*/
private String remark;
/**
* 分组ID,用于分组查询
**/
* 分组 ID,用于分组查询
*/
private Long groupId;
/**
@@ -107,27 +124,45 @@ public class IoTCommonDevice extends BaseDO {
*/
private Integer isSimulate;
/**
* 连接协议类型
*/
private ConnectType connectType;
/**
* 是否已注册(非数据库字段)
*/
@TableField(exist = false)
private Boolean hasRegister;
private Long orgId; //组织id
private Long siteId; //场站id
private Long modelId; //属于某个设备模型
/**
* 组织 ID
*/
private Long orgId;
/**
* 产品ID
* 场站 ID
*/
private Long siteId;
/**
* 物模型 ID
*/
private Long modelId;
/**
* 产品 ID
*/
private Long productId;
/**
* 产品名称
*/
private String productName;
/**
* 属性列表(非数据库字段)
*/
@TableField(exist = false)
private List<DeviceModelProperty> propertyList;
}