diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml
index 924e52eedd..486fe124b3 100644
--- a/yudao-dependencies/pom.xml
+++ b/yudao-dependencies/pom.xml
@@ -33,6 +33,7 @@
8.1.3.62
8.6.0
5.0.2
+ 3.3.3
2.3.0
@@ -253,6 +254,12 @@
${kingbase.jdbc.version}
+
+ com.taosdata.jdbc
+ taos-jdbcdriver
+ ${taos.version}
+
+
cn.iocoder.boot
diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/pom.xml b/yudao-framework/yudao-spring-boot-starter-mybatis/pom.xml
index 1f04e4a635..e907a2de4d 100644
--- a/yudao-framework/yudao-spring-boot-starter-mybatis/pom.xml
+++ b/yudao-framework/yudao-spring-boot-starter-mybatis/pom.xml
@@ -63,6 +63,10 @@
opengauss-jdbc
true
+
+ com.taosdata.jdbc
+ taos-jdbcdriver
+
com.alibaba
diff --git a/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/BaseEntity.java b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/BaseEntity.java
new file mode 100644
index 0000000000..74a4c8494b
--- /dev/null
+++ b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/BaseEntity.java
@@ -0,0 +1,25 @@
+package cn.iocoder.yudao.module.iot.domain;
+
+import lombok.Data;
+
+/**
+ * @ClassDescription: tdEngine的基础实体类
+ * @ClassName: BaseEntity
+ * @Author: fxlinks
+ * @Date: 2021-12-30 14:39:25
+ * @Version 1.0
+ */
+@Data
+public class BaseEntity {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 数据库名称
+ */
+ private String dataBaseName;
+
+ /**
+ * 超级表名称
+ */
+ private String superTableName;
+}
diff --git a/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/DeviceDataExportExcelDto.java b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/DeviceDataExportExcelDto.java
new file mode 100644
index 0000000000..cedb4d1190
--- /dev/null
+++ b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/DeviceDataExportExcelDto.java
@@ -0,0 +1,35 @@
+package cn.iocoder.yudao.module.iot.domain;
+
+import lombok.Data;
+
+/**
+ * 设备数据导出 excel DTO
+ */
+@Data
+public class DeviceDataExportExcelDto {
+
+ /**
+ * 设备标识
+ */
+ private String deviceKey;
+
+ /**
+ * 导出形式 1 单个参数导出 2 全部参数导出
+ */
+ private String exportType;
+
+ /**
+ * 导出开始时间
+ */
+ private String exportBeginTime;
+
+ /**
+ * 导出结束时间
+ */
+ private String exportEndTime;
+
+ /**
+ * 导出参数,空则导出全部
+ */
+ private String exportParameter;
+}
diff --git a/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/DeviceDataVo.java b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/DeviceDataVo.java
new file mode 100644
index 0000000000..b9f6fc4127
--- /dev/null
+++ b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/DeviceDataVo.java
@@ -0,0 +1,19 @@
+package cn.iocoder.yudao.module.iot.domain;
+
+import lombok.Data;
+
+/**
+ * @ClassDescription: 查询可视化所需入参对象
+ * @ClassName: SelectDto
+ * @Author: andyz
+ * @Date: 2022-07-29 14:12:26
+ * @Version 1.0
+ */
+@Data
+public class DeviceDataVo {
+
+
+ private String deviceId;
+
+ private Long lastTime;
+}
diff --git a/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/Fields.java b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/Fields.java
new file mode 100644
index 0000000000..bbd7bb74e8
--- /dev/null
+++ b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/Fields.java
@@ -0,0 +1,72 @@
+package cn.iocoder.yudao.module.iot.domain;
+
+import lombok.Data;
+
+/**
+ * @ClassDescription: 建表的字段实体类
+ * @ClassName: Fields
+ * @Author: fxlinks
+ * @Date: 2021-12-28 09:09:04
+ * @Version 1.0
+ */
+@Data
+public class Fields {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 字段名称
+ */
+ private String fieldName;
+
+ /**
+ * 字段值
+ */
+ private Object fieldValue;
+
+ /**
+ * 字段数据类型
+ */
+// private DataTypeEnum dataType;
+
+ /**
+ * 字段字节大小
+ */
+ private Integer size;
+
+ public Fields() {
+ }
+
+ public Fields(String fieldName, String dataType, Integer size) {
+// this.fieldName = fieldName;
+// //根据规则匹配字段数据类型
+// switch (dataType.toLowerCase()) {
+// case ("json"):
+// this.dataType = DataTypeEnum.JSON;
+// this.size = size;
+// break;
+// case ("string"):
+// this.dataType = DataTypeEnum.NCHAR;
+// this.size = size;
+// break;
+// case ("binary"):
+// this.dataType = DataTypeEnum.BINARY;
+// this.size = size;
+// break;
+// case ("int"):
+// this.dataType = DataTypeEnum.INT;
+// break;
+// case ("bool"):
+// this.dataType = DataTypeEnum.BOOL;
+// break;
+// case ("decimal"):
+// this.dataType = DataTypeEnum.DOUBLE;
+// break;
+// case ("timestamp"):
+// if ("eventTime".equals(fieldName)) {
+// this.fieldName = "eventTime";
+// }
+// this.dataType = DataTypeEnum.TIMESTAMP;
+// break;
+// }
+ }
+}
diff --git a/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/FieldsVo.java b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/FieldsVo.java
new file mode 100644
index 0000000000..554d52149d
--- /dev/null
+++ b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/FieldsVo.java
@@ -0,0 +1,68 @@
+package cn.iocoder.yudao.module.iot.domain;
+
+import lombok.Data;
+
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @ClassDescription: 建表的字段实体类的vo类
+ * @ClassName: FieldsVo
+ * @Author: fxlinks
+ * @Date: 2021-12-28 11:30:06
+ * @Version 1.0
+ */
+@Data
+public class FieldsVo {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 字段名称
+ */
+ private String fieldName;
+
+ /**
+ * 字段数据类型
+ */
+ private String dataType;
+
+ /**
+ * 字段字节大小
+ */
+ private Integer size;
+
+ /**
+ * @param fields 字段实体类
+ * @return FieldsVo 字段实体vo类
+ * @MethodDescription 字段实体类转为vo类
+ * @author fx
+ * @Date 2021/12/28 13:48
+ */
+ public static FieldsVo fieldsTranscoding(Fields fields) throws SQLException {
+// if (StringUtils.isBlank(fields.getFieldName()) || fields.getDataType() == null) {
+// throw new SQLException("invalid operation: fieldName or dataType can not be null");
+// }
+// FieldsVo fieldsVo = new FieldsVo();
+// fieldsVo.setFieldName(fields.getFieldName());
+// fieldsVo.setDataType(fields.getDataType().getDataType());
+// fieldsVo.setSize(fields.getSize());
+// return fieldsVo;
+ return null;
+ }
+
+ /**
+ * @param fieldsList 字段实体类集合
+ * @return List 字段实体vo类集合
+ * @MethodDescription 字段实体类集合转为vo类集合
+ * @author fx
+ * @Date 2021/12/28 14:00
+ */
+ public static List fieldsTranscoding(List fieldsList) throws SQLException {
+ List fieldsVoList = new ArrayList<>();
+ for (Fields fields : fieldsList) {
+ fieldsVoList.add(fieldsTranscoding(fields));
+ }
+ return fieldsVoList;
+ }
+}
diff --git a/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/IotSequential.java b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/IotSequential.java
new file mode 100644
index 0000000000..349d6d1371
--- /dev/null
+++ b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/IotSequential.java
@@ -0,0 +1,71 @@
+package cn.iocoder.yudao.module.iot.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.sql.Timestamp;
+
+public class IotSequential extends BaseEntity {
+ private static final long serialVersionUID = 1L;
+
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS" , timezone = "GMT+8")
+ private Timestamp statetime;
+
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS" , timezone = "GMT+8")
+ private Timestamp endtime;
+
+ private String deviceid;
+
+ private String eventtime;
+
+ private String serviceid;
+
+ private String devices;
+
+ public String getDeviceid() {
+ return deviceid;
+ }
+
+ public void setDeviceid(String deviceid) {
+ this.deviceid = deviceid;
+ }
+
+ public String getEventtime() {
+ return eventtime;
+ }
+
+ public void setEventtime(String eventtime) {
+ this.eventtime = eventtime;
+ }
+
+ public String getServiceid() {
+ return serviceid;
+ }
+
+ public void setServiceid(String serviceid) {
+ this.serviceid = serviceid;
+ }
+
+ public String getDevices() {
+ return devices;
+ }
+
+ public void setDevices(String devices) {
+ this.devices = devices;
+ }
+
+ public Timestamp getStatetime() {
+ return statetime;
+ }
+
+ public void setStatetime(Timestamp statetime) {
+ this.statetime = statetime;
+ }
+
+ public Timestamp getEndtime() {
+ return endtime;
+ }
+
+ public void setEndtime(Timestamp endtime) {
+ this.endtime = endtime;
+ }
+}
diff --git a/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/MessageCountVo.java b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/MessageCountVo.java
new file mode 100644
index 0000000000..e9e93cac01
--- /dev/null
+++ b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/MessageCountVo.java
@@ -0,0 +1,25 @@
+package cn.iocoder.yudao.module.iot.domain;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 统计的时间数据
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class MessageCountVo {
+
+ /**
+ * 时间
+ */
+ private String time;
+
+ /**
+ * 数据值
+ */
+ private Object data;
+
+}
diff --git a/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/ProductSuperTableModel.java b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/ProductSuperTableModel.java
new file mode 100644
index 0000000000..49887415c7
--- /dev/null
+++ b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/ProductSuperTableModel.java
@@ -0,0 +1,39 @@
+package cn.iocoder.yudao.module.iot.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.sql.Timestamp;
+import java.util.HashMap;
+import java.util.Optional;
+
+/**
+ * @Description: 产品超级表模型
+ * @Author: fx
+ * @Website: http://www.sxfxck.com
+ * @CreateDate: 2022/1/1$ 19:37$
+ * @UpdateUser: fx
+ * @UpdateDate: 2022/1/1$ 19:37$
+ * @UpdateRemark: 修改内容
+ * @Version: V1.0
+ */
+@Data
+public class ProductSuperTableModel {
+ private static final long serialVersionUID = 1L;
+
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS" , timezone = "GMT+8")
+ private Timestamp ts;
+
+ private String superTableName;
+
+ /**
+ * columnsName,columnsProperty
+ */
+ private HashMap columns;
+
+ /**
+ * tagsName,tagsProperty
+ */
+ private HashMap tags;
+
+}
diff --git a/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/SelectDto.java b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/SelectDto.java
new file mode 100644
index 0000000000..381ef3d6f1
--- /dev/null
+++ b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/SelectDto.java
@@ -0,0 +1,37 @@
+package cn.iocoder.yudao.module.iot.domain;
+
+import lombok.Data;
+
+import java.util.Set;
+
+/**
+ * @ClassDescription: 查询所需入参对象
+ * @ClassName: SelectDto
+ * @Author: fxlinks
+ * @Date: 2022-01-07 14:12:26
+ * @Version 1.0
+ */
+@Data
+public class SelectDto {
+
+ // @NotBlank(message = "invalid operation: dataBaseName can not be empty")
+ private String dataBaseName;
+
+// @NotBlank(message = "invalid operation: tableName can not be empty")
+ private String tableName;
+
+ // @NotBlank(message = "invalid operation: fieldName can not be empty")
+ private String fieldName;
+
+ // @NotNull(message = "invalid operation: startTime can not be null")
+ private Long startTime;
+
+ // @NotNull(message = "invalid operation: endTime can not be null")
+ private Long endTime;
+
+ private String type;
+
+ private Set orgIds;
+
+ private String deviceId;
+}
diff --git a/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/SuperTableDto.java b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/SuperTableDto.java
new file mode 100644
index 0000000000..ee80d42cfd
--- /dev/null
+++ b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/SuperTableDto.java
@@ -0,0 +1,38 @@
+package cn.iocoder.yudao.module.iot.domain;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @ClassDescription: 创建超级表需要的入参的实体类
+ * @ClassName: SuperTableDto
+ * @Author: fxlinks
+ * @Date: 2021-12-28 15:03:45
+ * @Version 1.0
+ */
+@Data
+public class SuperTableDto extends BaseEntity {
+
+ /**
+ * 超级表的表结构(业务相关)
+ * 第一个字段的数据类型必须为timestamp
+ * 字符相关数据类型必须指定大小
+ * 字段名称和字段数据类型不能为空
+ */
+// @NotEmpty(message = "invalid operation: schemaFields can not be empty")
+ private List schemaFields;
+
+ /**
+ * 超级表的标签字段,可以作为子表在超级表里的标识
+ * 字符相关数据类型必须指定大小
+ * 字段名称和字段数据类型不能为空
+ */
+// @NotEmpty(message = "invalid operation: tagsFields can not be empty")
+ private List tagsFields;
+
+ /**
+ * 字段信息对象,超级表添加列时使用该属性
+ */
+ private Fields fields;
+}
diff --git a/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/TableDto.java b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/TableDto.java
new file mode 100644
index 0000000000..f27beb1a69
--- /dev/null
+++ b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/TableDto.java
@@ -0,0 +1,33 @@
+package cn.iocoder.yudao.module.iot.domain;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @ClassDescription: 创建超级表的子表需要的入参的实体类
+ * @ClassName: TableDto
+ * @Author: fxlinks
+ * @Date: 2021-12-30 14:42:47
+ * @Version 1.0
+ */
+@Data
+public class TableDto extends BaseEntity {
+
+ /**
+ * 超级表普通列字段的值
+ * 值需要与创建超级表时普通列字段的数据类型对应上
+ */
+ private List schemaFieldValues;
+
+ /**
+ * 超级表标签字段的值
+ * 值需要与创建超级表时标签字段的数据类型对应上
+ */
+ private List tagsFieldValues;
+
+ /**
+ * 表名称
+ */
+ private String tableName;
+}
diff --git a/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/TagsSelectDao.java b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/TagsSelectDao.java
new file mode 100644
index 0000000000..5cb9c5ed92
--- /dev/null
+++ b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/TagsSelectDao.java
@@ -0,0 +1,33 @@
+package cn.iocoder.yudao.module.iot.domain;
+
+import lombok.Data;
+
+
+/**
+ * @program: fxlinks
+ * @description: 标签查询模型
+ * @packagename: com.fx.tdengine.api.domain.rule
+ * @author: fx
+ * @e-mainl: 13733918655@163.com
+ * @date: 2022-07-27 18:40
+ **/
+@Data
+public class TagsSelectDao {
+
+// @NotBlank(message = "invalid operation: dataBaseName can not be empty")
+ private String dataBaseName;
+
+// @NotBlank(message = "invalid operation: stableName can not be empty")
+ private String stableName;
+
+// @NotBlank(message = "invalid operation: tagsName can not be empty")
+ private String tagsName;
+
+ // @NotNull(message = "invalid operation: startTime can not be null")
+ private Long startTime;
+
+ // @NotNull(message = "invalid operation: endTime can not be null")
+ private Long endTime;
+
+
+}
diff --git a/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/Weather.java b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/Weather.java
new file mode 100644
index 0000000000..a4a1e983b8
--- /dev/null
+++ b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/Weather.java
@@ -0,0 +1,73 @@
+package cn.iocoder.yudao.module.iot.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.sql.Timestamp;
+
+public class Weather {
+
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS" , timezone = "GMT+8")
+ private Timestamp ts;
+ private Float temperature;
+ private Float humidity;
+ private String location;
+ private String note;
+ private int groupId;
+
+ public Weather() {
+ }
+
+ public Weather(Timestamp ts, float temperature, float humidity) {
+ this.ts = ts;
+ this.temperature = temperature;
+ this.humidity = humidity;
+ }
+
+ public Timestamp getTs() {
+ return ts;
+ }
+
+ public void setTs(Timestamp ts) {
+ this.ts = ts;
+ }
+
+ public Float getTemperature() {
+ return temperature;
+ }
+
+ public void setTemperature(Float temperature) {
+ this.temperature = temperature;
+ }
+
+ public Float getHumidity() {
+ return humidity;
+ }
+
+ public void setHumidity(Float humidity) {
+ this.humidity = humidity;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
+ public int getGroupId() {
+ return groupId;
+ }
+
+ public void setGroupId(int groupId) {
+ this.groupId = groupId;
+ }
+
+ public String getNote() {
+ return note;
+ }
+
+ public void setNote(String note) {
+ this.note = note;
+ }
+}
diff --git a/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/visual/SelectVisualDto.java b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/visual/SelectVisualDto.java
new file mode 100644
index 0000000000..1444da9727
--- /dev/null
+++ b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/domain/visual/SelectVisualDto.java
@@ -0,0 +1,58 @@
+package cn.iocoder.yudao.module.iot.domain.visual;
+
+import lombok.Data;
+
+import java.util.Map;
+
+/**
+ * @ClassDescription: 查询可视化所需入参对象
+ * @ClassName: SelectDto
+ * @Author: andyz
+ * @Date: 2022-07-29 14:12:26
+ * @Version 1.0
+ */
+@Data
+public class SelectVisualDto {
+
+// @NotBlank(message = "invalid operation: tableName can not be empty")
+ private String dataBaseName;
+
+// @NotBlank(message = "invalid operation: tableName can not be empty")
+ private String tableName;
+
+// @NotBlank(message = "invalid operation: fieldName can not be empty") //属性
+ private String fieldName;
+ /**
+ * 查询类型,0历史数据,1实时数据,2聚合数据
+ */
+ private int type;
+ /**
+ * 查询的数据量
+ */
+ private int num;
+ /**
+ * 聚合函数
+ */
+ private String aggregate;
+ /**
+ * 统计间隔数字+s/m/h/d
+ * 比如1s,1m,1h,1d代表1秒,1分钟,1小时,1天
+ */
+ private String interval;
+ // @NotNull(message = "invalid operation: startTime can not be null")
+ private Long startTime;
+
+ // @NotNull(message = "invalid operation: endTime can not be null")
+ private Long endTime;
+
+ /**
+ * 请求参数
+ */
+ private Map params;
+
+ private String sql;
+
+ private String deviceId;
+
+ private Long lastTime;
+}
diff --git a/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/enums/product/IotProductFunctionTypeEnum.java b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/enums/product/IotProductFunctionTypeEnum.java
index 7a924997a5..b99d2b0938 100644
--- a/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/enums/product/IotProductFunctionTypeEnum.java
+++ b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/enums/product/IotProductFunctionTypeEnum.java
@@ -30,6 +30,15 @@ public enum IotProductFunctionTypeEnum implements IntArrayValuable {
*/
private final String description;
+ public static IotProductFunctionTypeEnum valueOf(Integer type) {
+ for (IotProductFunctionTypeEnum value : values()) {
+ if (value.getType().equals(type)) {
+ return value;
+ }
+ }
+ return null;
+ }
+
@Override
public int[] array() {
return ARRAYS;
diff --git a/yudao-module-iot/yudao-module-iot-biz/pom.xml b/yudao-module-iot/yudao-module-iot-biz/pom.xml
index e3f93086ae..cb2fd818f9 100644
--- a/yudao-module-iot/yudao-module-iot-biz/pom.xml
+++ b/yudao-module-iot/yudao-module-iot-biz/pom.xml
@@ -42,6 +42,11 @@
yudao-spring-boot-starter-mybatis
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-redis
+
+
cn.iocoder.boot
diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/product/IotProductController.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/product/IotProductController.java
index 5b0ecb27ae..e7f41d91dc 100644
--- a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/product/IotProductController.java
+++ b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/product/IotProductController.java
@@ -83,11 +83,10 @@ public class IotProductController {
return success(BeanUtils.toBean(pageResult, IotProductRespVO.class));
}
- // TODO @haohao:改成 simple-list 哈
- @GetMapping("/list-all-simple")
+ @GetMapping("/simple-list")
@Operation(summary = "获得所有产品列表")
@PreAuthorize("@ss.hasPermission('iot:product:query')")
- public CommonResult> listAllSimpleProducts() {
+ public CommonResult> getSimpleProductList() {
List list = productService.getProductList();
return success(BeanUtils.toBean(list, IotProductSimpleRespVO.class));
}
diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/thinkmodelfunction/thingModel/ThingModelRespVO.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/thinkmodelfunction/thingModel/ThingModelRespVO.java
new file mode 100644
index 0000000000..6fc48ef4f7
--- /dev/null
+++ b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/thinkmodelfunction/thingModel/ThingModelRespVO.java
@@ -0,0 +1,51 @@
+package cn.iocoder.yudao.module.iot.controller.admin.thinkmodelfunction.thingModel;
+
+import lombok.*;
+
+import java.util.List;
+import java.util.Map;
+
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@ToString
+public class ThingModelRespVO {
+
+ /**
+ * 产品编号
+ */
+ private Long id;
+
+ /**
+ * 产品标识
+ */
+ private String productKey;
+
+ /**
+ * 物模型
+ */
+ private Model model;
+
+ /**
+ * 物模型
+ */
+ @Data
+ public static class Model {
+
+ /**
+ * 属性列表
+ */
+ private List properties;
+
+ /**
+ * 服务列表
+ */
+ private List services;
+
+ /**
+ * 事件列表
+ */
+ private List events;
+ }
+}
diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/tdengine/FieldParser.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/tdengine/FieldParser.java
new file mode 100644
index 0000000000..0a91e7cf19
--- /dev/null
+++ b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/tdengine/FieldParser.java
@@ -0,0 +1,80 @@
+package cn.iocoder.yudao.module.iot.dal.dataobject.tdengine;
+
+
+import cn.iocoder.yudao.module.iot.controller.admin.thinkmodelfunction.thingModel.ThingModelProperty;
+import cn.iocoder.yudao.module.iot.controller.admin.thinkmodelfunction.thingModel.ThingModelRespVO;
+import cn.iocoder.yudao.module.iot.controller.admin.thinkmodelfunction.thingModel.dataType.ThingModelDataType;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class FieldParser {
+
+ /**
+ * 物模型到td数据类型映射
+ */
+ private static final HashMap TYPE_MAPPING = new HashMap<>() {{
+ put("INT", "INT");
+ put("FLOAT", "FLOAT");
+ put("DOUBLE", "DOUBLE");
+ put("BOOL", "BOOL");
+ put("ENUM", "NCHAR");
+ put("TEXT", "NCHAR");
+ put("DATE", "NCHAR");
+ }};
+
+
+ /**
+ * 将物模型字段转换为td字段
+ *
+ * @param property 物模型属性
+ * @return TdField对象
+ */
+ public static TdField parse(ThingModelProperty property) {
+ String fieldName = property.getIdentifier().toLowerCase();
+ ThingModelDataType type = property.getDataType();
+
+ // 将物模型字段类型映射为td字段类型
+ String fType = TYPE_MAPPING.get(type.getType().toUpperCase());
+
+ int len = -1;
+ // 如果字段类型为NCHAR,默认长度为64
+ if ("NCHAR".equals(fType)) {
+ len = 64;
+ }
+
+ return new TdField(fieldName, fType, len);
+ }
+
+ /**
+ * 获取物模型中的字段列表
+ */
+ public static List parse(ThingModelRespVO thingModel) {
+ return thingModel.getModel().getProperties().stream().map(FieldParser::parse).collect(Collectors.toList());
+ }
+
+ /**
+ * 将从库中查出来的字段信息转换为td字段对象
+ */
+ public static List parse(List rows) {
+ return (List) rows.stream().map((r) -> {
+ List row = (List) r;
+ String type = row.get(1).toString().toUpperCase();
+ return new TdField(
+ row.get(0).toString(),
+ type,
+ type.equals("NCHAR") ? Integer.parseInt(row.get(2).toString()) : -1);
+ }).collect(Collectors.toList());
+ }
+
+ /**
+ * 获取字段字义
+ */
+ public static String getFieldDefine(TdField field) {
+ return "`" + field.getName() + "`" + " " + (field.getLength() > 0 ?
+ String.format("%s(%d)", field.getType(), field.getLength())
+ : field.getType());
+ }
+
+}
diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/tdengine/TableData.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/tdengine/TableData.java
new file mode 100644
index 0000000000..1d42933d4c
--- /dev/null
+++ b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/tdengine/TableData.java
@@ -0,0 +1,36 @@
+package cn.iocoder.yudao.module.iot.dal.dataobject.tdengine;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class TableData {
+
+ /**
+ * 超级表普通列字段的名称
+ */
+ private List schemaFieldList;
+
+ /**
+ * 超级表标签字段的值
+ * 值需要与创建超级表时标签字段的数据类型对应上
+ */
+ private List