【优化功能】 优化 tdengine 操作数据库相关代码
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
package cn.iocoder.yudao.module.iot.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 数据库名称
|
||||
*/
|
||||
private String dataBaseName;
|
||||
|
||||
/**
|
||||
* 超级表名称
|
||||
*/
|
||||
private String superTableName;
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
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;
|
||||
}
|
@@ -1,19 +0,0 @@
|
||||
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;
|
||||
}
|
@@ -1,65 +0,0 @@
|
||||
package cn.iocoder.yudao.module.iot.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@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;
|
||||
// }
|
||||
}
|
||||
}
|
@@ -1,31 +0,0 @@
|
||||
package cn.iocoder.yudao.module.iot.domain;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字段信息 VO
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class FieldsVo {
|
||||
|
||||
/**
|
||||
* 字段名称
|
||||
*/
|
||||
private String fieldName;
|
||||
|
||||
/**
|
||||
* 字段数据类型
|
||||
*/
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
* 字段字节大小
|
||||
*/
|
||||
private Integer size;
|
||||
}
|
@@ -1,71 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
@@ -1,25 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
@@ -1,29 +0,0 @@
|
||||
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;
|
||||
|
||||
@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<Optional, Optional> columns;
|
||||
|
||||
/**
|
||||
* tagsName,tagsProperty
|
||||
*/
|
||||
private HashMap<Optional, Optional> tags;
|
||||
|
||||
}
|
@@ -1,30 +0,0 @@
|
||||
package cn.iocoder.yudao.module.iot.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@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<Integer> orgIds;
|
||||
|
||||
private String deviceId;
|
||||
}
|
@@ -1,31 +0,0 @@
|
||||
package cn.iocoder.yudao.module.iot.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SuperTableDto extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 超级表的表结构(业务相关)
|
||||
* 第一个字段的数据类型必须为timestamp
|
||||
* 字符相关数据类型必须指定大小
|
||||
* 字段名称和字段数据类型不能为空
|
||||
*/
|
||||
// @NotEmpty(message = "invalid operation: schemaFields can not be empty")
|
||||
private List<Fields> schemaFields;
|
||||
|
||||
/**
|
||||
* 超级表的标签字段,可以作为子表在超级表里的标识
|
||||
* 字符相关数据类型必须指定大小
|
||||
* 字段名称和字段数据类型不能为空
|
||||
*/
|
||||
// @NotEmpty(message = "invalid operation: tagsFields can not be empty")
|
||||
private List<Fields> tagsFields;
|
||||
|
||||
/**
|
||||
* 字段信息对象,超级表添加列时使用该属性
|
||||
*/
|
||||
private Fields fields;
|
||||
}
|
@@ -1,26 +0,0 @@
|
||||
package cn.iocoder.yudao.module.iot.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class TableDto extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 超级表普通列字段的值
|
||||
* 值需要与创建超级表时普通列字段的数据类型对应上
|
||||
*/
|
||||
private List<Fields> schemaFieldValues;
|
||||
|
||||
/**
|
||||
* 超级表标签字段的值
|
||||
* 值需要与创建超级表时标签字段的数据类型对应上
|
||||
*/
|
||||
private List<Fields> tagsFieldValues;
|
||||
|
||||
/**
|
||||
* 表名称
|
||||
*/
|
||||
private String tableName;
|
||||
}
|
@@ -1,25 +0,0 @@
|
||||
package cn.iocoder.yudao.module.iot.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@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;
|
||||
|
||||
|
||||
}
|
@@ -1,73 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
@@ -1,63 +0,0 @@
|
||||
package cn.iocoder.yudao.module.iot.domain.visual;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class SelectVisualDto {
|
||||
|
||||
/**
|
||||
* 数据库名称
|
||||
*/
|
||||
private String dataBaseName;
|
||||
|
||||
/**
|
||||
* 表名
|
||||
*/
|
||||
private String tableName;
|
||||
|
||||
/**
|
||||
* 属性
|
||||
*/
|
||||
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;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Long startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Long endTime;
|
||||
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
private Map<String, Object> params;
|
||||
|
||||
private String sql;
|
||||
|
||||
private String deviceId;
|
||||
|
||||
private Long lastTime;
|
||||
}
|
Reference in New Issue
Block a user