初次提交
This commit is contained in:
3
td-service/danji.Dockerfile
Normal file
3
td-service/danji.Dockerfile
Normal file
@ -0,0 +1,3 @@
|
||||
FROM jenkins/jenkins
|
||||
ADD target/td-service.jar /td-service.jar
|
||||
ENTRYPOINT ["java","-jar","/td-service.jar","--spring.profiles.active=danji","-c"]
|
||||
3
td-service/open.Dockerfile
Normal file
3
td-service/open.Dockerfile
Normal file
@ -0,0 +1,3 @@
|
||||
FROM jenkins/jenkins
|
||||
ADD target/td-service.jar /td-service.jar
|
||||
ENTRYPOINT ["java","-jar","/td-service.jar","--spring.profiles.active=open","-c"]
|
||||
124
td-service/pom.xml
Normal file
124
td-service/pom.xml
Normal file
@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ho-cloud</artifactId>
|
||||
<groupId>com.hoenergy</groupId>
|
||||
<version>1.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>td-service</artifactId>
|
||||
|
||||
<properties>
|
||||
<td-service-api.version>1.0</td-service-api.version>
|
||||
<data-collect-service-api.version>1.0</data-collect-service-api.version>
|
||||
<business-service-api.version>1.0</business-service-api.version>
|
||||
<common-tools.version>1.0</common-tools.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!--junit-->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
</dependency>
|
||||
<!--spring test-->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-test</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.hoenergy</groupId>
|
||||
<artifactId>td-service-api</artifactId>
|
||||
<version>${td-service-api.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.hoenergy</groupId>
|
||||
<artifactId>business-service-api</artifactId>
|
||||
<version>${business-service-api.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.hoenergy</groupId>
|
||||
<artifactId>common-tools</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!--依赖数据采集api-->
|
||||
<dependency>
|
||||
<groupId>com.hoenergy</groupId>
|
||||
<artifactId>data-collect-service-api</artifactId>
|
||||
<version>${data-collect-service-api.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.hoenergy</groupId>
|
||||
<artifactId>common-tools</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!--springboot web-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<!--springboot admin -client-->
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-starter-client</artifactId>
|
||||
</dependency>
|
||||
<!--OpenFeign-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
<!--SpringCloud ailibaba nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<!--taos-->
|
||||
<dependency>
|
||||
<groupId>com.taosdata.jdbc</groupId>
|
||||
<artifactId>taos-jdbcdriver</artifactId>
|
||||
</dependency>
|
||||
<!--Druid数据库连接-->
|
||||
<!--<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
</dependency>-->
|
||||
<!--mybatis-->
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<defaultGoal>compile</defaultGoal>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.2.12.RELEASE</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<skipTests>true</skipTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
24
td-service/src/main/java/com/ho/td/TdApplication.java
Normal file
24
td-service/src/main/java/com/ho/td/TdApplication.java
Normal file
@ -0,0 +1,24 @@
|
||||
package com.ho.td;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
|
||||
/**
|
||||
* @author fancl
|
||||
* @description: tdengin操作程序入口
|
||||
* @date 2022/8/9
|
||||
*/
|
||||
@SpringBootApplication(scanBasePackages = {"com.ho.common.tools","com.ho.td"})
|
||||
@EnableDiscoveryClient
|
||||
@EnableFeignClients
|
||||
@EnableAsync //开启异步
|
||||
@MapperScan(basePackages = {"com.ho.td.mapper"})
|
||||
public class TdApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(TdApplication.class, args);
|
||||
}
|
||||
}
|
||||
49
td-service/src/main/java/com/ho/td/config/TDenginConfig.java
Normal file
49
td-service/src/main/java/com/ho/td/config/TDenginConfig.java
Normal file
@ -0,0 +1,49 @@
|
||||
package com.ho.td.config;
|
||||
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.mybatis.spring.SqlSessionFactoryBean;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.jdbc.DataSourceBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
/**
|
||||
* @author fancl
|
||||
* @desc: tdengin配置
|
||||
* @date 2022/9/3
|
||||
*/
|
||||
//@Configuration
|
||||
//@MapperScan(basePackages = {"com.ho.td.mapper"}, sqlSessionTemplateRef = "tdengineSqlSessionTemplate")
|
||||
public class TDenginConfig {
|
||||
|
||||
@Bean(name = "tdengineDataSource")
|
||||
@ConfigurationProperties(prefix = "spring.datasource.tdengine-server")
|
||||
public DataSource tdengineDataSource() {
|
||||
return DataSourceBuilder.create().build();
|
||||
}
|
||||
|
||||
@Bean(name = "tdengineSqlSessionFactory")
|
||||
public SqlSessionFactory tdengineSqlSessionFactory(@Qualifier("tdengineDataSource") DataSource dataSource) throws Exception {
|
||||
SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
|
||||
bean.setDataSource(dataSource);
|
||||
bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/*.xml"));
|
||||
return bean.getObject();
|
||||
}
|
||||
|
||||
@Bean(name = "tdengineTransactionManager")
|
||||
public DataSourceTransactionManager tdengineTransactionManager(@Qualifier("tdengineDataSource") DataSource dataSource) {
|
||||
return new DataSourceTransactionManager(dataSource);
|
||||
}
|
||||
|
||||
@Bean(name = "tdengineSqlSessionTemplate")
|
||||
public SqlSessionTemplate tdengineSqlSessionTemplate(@Qualifier("tdengineSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception {
|
||||
return new SqlSessionTemplate(sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
107
td-service/src/main/java/com/ho/td/config/TdServiceAspect.java
Normal file
107
td-service/src/main/java/com/ho/td/config/TdServiceAspect.java
Normal file
@ -0,0 +1,107 @@
|
||||
package com.ho.td.config;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.ho.common.tools.constant.CommonConstant;
|
||||
import com.ho.common.tools.constant.RedisKeyConstant;
|
||||
import com.ho.common.tools.entity.SimpleUser;
|
||||
import com.ho.common.tools.entity.UserDetailRespVO;
|
||||
import com.ho.common.tools.service.RedisService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* 模块切面
|
||||
* 目前实现日志和token校验
|
||||
*/
|
||||
@Aspect
|
||||
@Component
|
||||
@Slf4j
|
||||
public class TdServiceAspect {
|
||||
|
||||
@Autowired
|
||||
RedisService redisService;
|
||||
|
||||
/**
|
||||
* 此处的切点是注解的方式
|
||||
* 只要出现 @LogAnnotation注解都会进入
|
||||
* 改为切入点是controller,不然日志记录不清晰,只有LogAnnotation才入库
|
||||
*/
|
||||
//@Pointcut("@annotation(com.ho.common.tools.annotation.LogAnnotation)")
|
||||
@Pointcut("execution(* com.ho.*.controller.*.*(..))")
|
||||
public void pointCut() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 环绕增强,相当于MethodInterceptor
|
||||
*
|
||||
* @param point
|
||||
* @return
|
||||
* @throws Throwable
|
||||
*/
|
||||
@Around("pointCut()")
|
||||
public Object around(ProceedingJoinPoint point) throws Throwable {
|
||||
long beginTime = System.currentTimeMillis();
|
||||
ServletRequestAttributes servletAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletRequest request = servletAttributes.getRequest();
|
||||
UserDetailRespVO userDetail = null;
|
||||
SimpleUser simpleUser = null;
|
||||
MethodSignature signature = (MethodSignature) point.getSignature();
|
||||
Method method = signature.getMethod();
|
||||
//是否是token忽略
|
||||
//TokenIgnore tokenIgnoreAnnotation = method.getAnnotation(TokenIgnore.class);
|
||||
//是否大屏token
|
||||
//LargeScreenToken largeScreenToken = method.getAnnotation(LargeScreenToken.class);
|
||||
String token = request.getHeader(RedisKeyConstant.User.ACCESS_TOKEN);
|
||||
//log.info("token:" + token);
|
||||
String url = request.getRequestURL().toString();
|
||||
String className = point.getTarget().getClass().getName();
|
||||
String methodName = signature.getName();
|
||||
log.info("请求url:{} ,method:{}, 开始时间: {}", url, method, beginTime);
|
||||
|
||||
//请求参数
|
||||
String params = null;
|
||||
try {
|
||||
//请求的参数
|
||||
Object[] args = point.getArgs();
|
||||
//MultipartFile类型的跳过转Json
|
||||
if (args != null && args.length > 0 && args[0] != null) {
|
||||
String simpleClassName = args[0].getClass().getSimpleName();
|
||||
log.info("SimpleClassName:" + simpleClassName);
|
||||
//不包含文件类型才打印日志
|
||||
if (!StringUtils.isBlank(simpleClassName) && !simpleClassName.contains("Multipart")) {
|
||||
params = JSON.toJSONString(args[0]);
|
||||
//log.info("params:" + params);
|
||||
log.info("params:" );
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
log.info("methodName:{}, className:{}", methodName, className);
|
||||
//执行目标方法
|
||||
//执行方法
|
||||
Object result = point.proceed();
|
||||
//方法执行结果
|
||||
//log.info("返回:" + JSON.toJSONString(result));
|
||||
//执行时长(毫秒)
|
||||
long time = System.currentTimeMillis() - beginTime;
|
||||
log.info("耗时:{}, url:{},param:{}", time, url ,null);
|
||||
if (time > CommonConstant.timeoutMilliSeconds) {
|
||||
log.error("接口超时: 耗时:{} ,url:{}",time, url);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
package com.ho.td.config;
|
||||
|
||||
import com.alibaba.druid.support.http.StatViewServlet;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.sql.DataSource;
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
/**
|
||||
* @author fancl
|
||||
* @desc: 线程池配置类
|
||||
* @date 2022/9/12
|
||||
*/
|
||||
@Configuration
|
||||
@Slf4j
|
||||
public class ThreadPoolConfig {
|
||||
|
||||
@Autowired
|
||||
DataSource dataSource;
|
||||
|
||||
@PostConstruct
|
||||
public void t(){
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Bean
|
||||
ThreadPoolTaskExecutor tdThreadPoolExecutor(){
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
int core = Runtime.getRuntime().availableProcessors();
|
||||
log.info("core:" +core);
|
||||
executor.setCorePoolSize(core);
|
||||
//最大线程数是核心线程数10倍
|
||||
executor.setMaxPoolSize(core * 10);
|
||||
//
|
||||
executor.setKeepAliveSeconds(600);
|
||||
executor.setQueueCapacity(core * 10);
|
||||
executor.setThreadNamePrefix("td-thread-execute");
|
||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
|
||||
@Bean
|
||||
ServletRegistrationBean regisDruid() {
|
||||
//固定写法,配置访问路径
|
||||
ServletRegistrationBean<StatViewServlet> bean = new ServletRegistrationBean<>(new StatViewServlet(), "/druid/*");
|
||||
//配置登录信息,固定写法
|
||||
HashMap<String, String> initParams = new HashMap<>();
|
||||
//账号和密码的key是固定的
|
||||
initParams.put("loginUsername", "fan");
|
||||
initParams.put("loginPassword", "111111");
|
||||
|
||||
//允许谁可以访问
|
||||
initParams.put("allow", "");
|
||||
bean.setInitParameters(initParams);
|
||||
return bean;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,122 @@
|
||||
package com.ho.td.mapper;
|
||||
|
||||
import com.ho.common.tools.vo.req.PointData;
|
||||
import com.ho.common.tools.vo.req.StationHomeRespVo;
|
||||
import com.ho.common.tools.vo.req.StatisticsCurve;
|
||||
import com.ho.datacollect.api.vo.req.StatisticsRespVO;
|
||||
import com.ho.datacollect.api.vo.req.add.TdBase;
|
||||
import com.ho.datacollect.api.vo.req.add.TdDeviceAddReq;
|
||||
import com.ho.td.api.entity.TransferDbReq;
|
||||
import com.ho.td.api.entity.inverter.InverterTimingGenerate;
|
||||
import com.ho.td.api.entity.query.ResultData;
|
||||
import com.ho.td.api.entity.query.TdBaseTimeQuery;
|
||||
import com.ho.td.api.entity.query.UpdateTdReq;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description DeviceComplexMapper
|
||||
* @Author xueweizhi
|
||||
* @Date 2023/3/16 09:30
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeviceComplexMapper {
|
||||
|
||||
//插入
|
||||
int insertDeviceComplex(TdDeviceAddReq device);
|
||||
|
||||
int insertDeviceComplex1(TdDeviceAddReq device);
|
||||
|
||||
int insertDeviceComplex2(TdDeviceAddReq device);
|
||||
|
||||
int insertDeviceComplex3(TdDeviceAddReq device);
|
||||
|
||||
int insertDeviceComplex4(TdDeviceAddReq device);
|
||||
|
||||
int insertDeviceComplex5(TdDeviceAddReq device);
|
||||
|
||||
int insertDeviceComplex6(TdDeviceAddReq device);
|
||||
|
||||
int insertDeviceComplex7(TdDeviceAddReq device);
|
||||
|
||||
List<StatisticsCurve> queryPointTableComplex(TdBaseTimeQuery query, String tableName);
|
||||
|
||||
List<PointData> queryPointDataShowComplex(TdBaseTimeQuery query, String tableName);
|
||||
|
||||
/**
|
||||
* 统计总条数
|
||||
* @param query
|
||||
* @param tableName
|
||||
* @return
|
||||
*/
|
||||
int countQueryPointDataShowComplex(TdBaseTimeQuery query, String tableName);
|
||||
|
||||
int countPointAllComplex(TdBase query, String tableName);
|
||||
|
||||
BigDecimal queryOneByTime(String tableName, String colName, Date time);
|
||||
|
||||
/**
|
||||
* 根据时间获取字段名称最大的值
|
||||
* @param tableName
|
||||
* @param colName
|
||||
* @param time
|
||||
* @return
|
||||
*/
|
||||
BigDecimal queryMaxOneByTime(String tableName, String colName, Date time);
|
||||
|
||||
StationHomeRespVo selectBeginTime(String col, String tableName, Long beginLong);
|
||||
|
||||
List<StationHomeRespVo> selectAll(TdBaseTimeQuery query, String tableName);
|
||||
List<StationHomeRespVo> selectEndPoint(TdBaseTimeQuery query, String tableName);
|
||||
|
||||
StationHomeRespVo selectEnd(String col, String tableName, Long endLong);
|
||||
|
||||
List<Map<String,Object>> selectAllValue(TdBase query, String tableName);
|
||||
|
||||
/**
|
||||
* 根据时间获取字段名称最大的值
|
||||
* @param tableName
|
||||
* @param colName
|
||||
* @param beginTime
|
||||
* @param time
|
||||
* @return
|
||||
*/
|
||||
BigDecimal queryMaxValue(String tableName, String colName, Date beginTime,Date time);
|
||||
|
||||
/**
|
||||
* 根据时间获取字段名称最小的值
|
||||
* @param tableName
|
||||
* @param colName
|
||||
* @param beginTime
|
||||
* @param time
|
||||
* @return
|
||||
*/
|
||||
BigDecimal queryMinOneByTime(String tableName, String colName, Date beginTime,Date time);
|
||||
|
||||
//查第一条数的时间
|
||||
Date selectFirstRecord(@Param("tableName") String tableName);
|
||||
|
||||
//按条件查询采样率
|
||||
List<StatisticsRespVO> selectInterval(@Param("tdBase") TdBase tdBase,
|
||||
@Param("colName") String colName,
|
||||
@Param("intervalTime") String s);
|
||||
|
||||
InverterTimingGenerate selectFirst(@Param("tbNameSuffix") String tbNameSuffix,
|
||||
@Param("beginTime") Long beginTime, @Param("endTime") Long endTime,
|
||||
@Param("orderType") String orderType,@Param("colName") String colName);
|
||||
|
||||
List<StatisticsRespVO> selectLastRecord(TdBase tdBase, @Param("colName") String colName, @Param("time") Long time);
|
||||
|
||||
List<ResultData> getData(UpdateTdReq updateTdReq);
|
||||
|
||||
void setData(@Param("resultData") ResultData resultData);
|
||||
|
||||
int modifyData(@Param("resultData") ResultData resultData);
|
||||
|
||||
StationHomeRespVo selectOneValue(String tableName, TdBaseTimeQuery query);
|
||||
}
|
||||
@ -0,0 +1,116 @@
|
||||
package com.ho.td.mapper;
|
||||
|
||||
import com.ho.common.tools.vo.req.PointData;
|
||||
import com.ho.common.tools.vo.req.StationHomeRespVo;
|
||||
import com.ho.common.tools.vo.req.StatisticsCurve;
|
||||
import com.ho.datacollect.api.vo.req.StatisticsRespVO;
|
||||
import com.ho.datacollect.api.vo.req.add.TdBase;
|
||||
import com.ho.datacollect.api.vo.req.add.TdDeviceAddReq;
|
||||
import com.ho.td.api.entity.inverter.InverterTimingGenerate;
|
||||
import com.ho.td.api.entity.query.TdBaseTimeQuery;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description DeviceSimpleMapper
|
||||
* @Author xueweizhi
|
||||
* @Date 2023/3/16 09:30
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeviceSimpleMapper {
|
||||
|
||||
//插入
|
||||
int insertDeviceSimple(TdDeviceAddReq device);
|
||||
|
||||
int insertDeviceSimpleNew(TdDeviceAddReq device);
|
||||
|
||||
List<StatisticsCurve> queryPointTableSimple(TdBaseTimeQuery query, String tableName);
|
||||
|
||||
List<PointData> queryPointDataShowSimple(TdBaseTimeQuery query, String tableName);
|
||||
/**
|
||||
* 根据字段名称和时间按时间倒序取最后一条
|
||||
* @param tableName 表名后缀
|
||||
* @param colName 字段名称
|
||||
* @param time 时间
|
||||
* @return
|
||||
*/
|
||||
BigDecimal queryOneByTime(String tableName, String colName, Date time);
|
||||
|
||||
/**
|
||||
* 根据时间获取字段名称最大的值
|
||||
* @param tableName
|
||||
* @param colName
|
||||
* @param beginTime
|
||||
* @param time
|
||||
* @return
|
||||
*/
|
||||
BigDecimal queryMaxOneByTime(String tableName, String colName, Date beginTime,Date time);
|
||||
|
||||
/**
|
||||
* 根据时间获取字段名称最大的值
|
||||
* @param tableName
|
||||
* @param colName
|
||||
* @param time
|
||||
* @return
|
||||
*/
|
||||
BigDecimal queryHisMaxOneByTime(String tableName, String colName, Date time);
|
||||
|
||||
/**
|
||||
* 统计字段数量
|
||||
* @param query
|
||||
* @param tableName
|
||||
* @return
|
||||
*/
|
||||
int countPointTableSimple(TdBaseTimeQuery query, String tableName);
|
||||
|
||||
StationHomeRespVo selectBeginTime(String col, String tableName, Long beginLong);
|
||||
|
||||
List<StationHomeRespVo> selectAll(TdBaseTimeQuery query, String tableName);
|
||||
|
||||
List<StationHomeRespVo> selectEndPoint(TdBaseTimeQuery query, String tableName);
|
||||
|
||||
StationHomeRespVo selectEnd(String col, String tableName,Long endLong);
|
||||
|
||||
List<Map<String,Object>> selectAllValue(TdBase query, String tableName);
|
||||
|
||||
int countPointAllSimple(TdBase query, String tableName);
|
||||
|
||||
/**
|
||||
* 根据时间获取字段名称最小的值
|
||||
* @param tableName
|
||||
* @param colName
|
||||
* @param beginTime
|
||||
* @param time
|
||||
* @return
|
||||
*/
|
||||
BigDecimal queryMinOneByTime(String tableName, String colName, Date beginTime,Date time);
|
||||
|
||||
//查第一条数的时间
|
||||
Date selectFirstRecord(@Param("tableName") String tableName);
|
||||
|
||||
//按条件查询采样率
|
||||
List<StatisticsRespVO> selectInterval(@Param("tdBase") TdBase tdBase,
|
||||
@Param("colName") String colName,
|
||||
@Param("intervalTime") String s);
|
||||
|
||||
InverterTimingGenerate selectFirst(@Param("tbNameSuffix") String tbNameSuffix,
|
||||
@Param("beginTime") Long beginTime, @Param("endTime") Long endTime,
|
||||
@Param("orderType") String orderType,@Param("colName") String colName);
|
||||
|
||||
List<StatisticsRespVO> selectLastRecord(TdBase tdBase, @Param("colName") String colName, @Param("time") Long time);
|
||||
|
||||
StationHomeRespVo selectOneValue(String tableName, TdBaseTimeQuery query);
|
||||
|
||||
StationHomeRespVo selectColFirst(String col, String tableName, Long beginLong);
|
||||
|
||||
List<StationHomeRespVo> selectColAll(TdBaseTimeQuery query, String tableName);
|
||||
|
||||
StationHomeRespVo selectColEnd(String col, String tableName,Long endLong);
|
||||
|
||||
List<StatisticsCurve> queryMeasure(TdBaseTimeQuery query, String tableName);
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package com.ho.td.service;
|
||||
|
||||
import com.ho.datacollect.api.vo.req.add.TdDeviceAddReq;
|
||||
import com.ho.td.api.entity.query.TdBaseTimeQuery;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface Device001Service {
|
||||
|
||||
/**
|
||||
* 更改历史值
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
int modifyHistoryData(TdBaseTimeQuery query);
|
||||
|
||||
void insertDeviceSimple(TdDeviceAddReq device);
|
||||
|
||||
void insertDeviceComplex(List<Integer> complexTableList,TdDeviceAddReq device);
|
||||
|
||||
/**
|
||||
* 动态插入sql
|
||||
* @param device
|
||||
*/
|
||||
void insertDynamicSimple(TdDeviceAddReq device);
|
||||
}
|
||||
@ -0,0 +1,160 @@
|
||||
package com.ho.td.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.ho.common.tools.constant.CommonConstant;
|
||||
import com.ho.common.tools.entity.PointCurveSrcCol;
|
||||
import com.ho.common.tools.util.DateNewUtil;
|
||||
import com.ho.datacollect.api.constant.DataCollectConstant;
|
||||
import com.ho.datacollect.api.vo.req.add.TdDeviceAddReq;
|
||||
import com.ho.td.api.entity.query.ResultData;
|
||||
import com.ho.td.api.entity.query.TdBaseTimeQuery;
|
||||
import com.ho.td.api.entity.query.UpdateTdReq;
|
||||
import com.ho.td.mapper.DeviceComplexMapper;
|
||||
import com.ho.td.mapper.DeviceSimpleMapper;
|
||||
import com.ho.td.service.Device001Service;
|
||||
import com.ho.td.util.TableUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.time.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class Device001ServiceImpl implements Device001Service {
|
||||
|
||||
@Autowired
|
||||
DeviceComplexMapper deviceComplexMapper;
|
||||
|
||||
@Autowired
|
||||
DeviceSimpleMapper deviceSimpleMapper;
|
||||
|
||||
@Override
|
||||
public int modifyHistoryData(TdBaseTimeQuery query) {
|
||||
Date start = DateUtil.parse(query.getBeginTime(), CommonConstant.DATE);
|
||||
Date end = DateUtil.parse(query.getEndTime(), CommonConstant.DATE);
|
||||
//按照15分钟自动补充值
|
||||
List<DateTime> times = DateUtil.rangeToList(DateNewUtil.roundToNearestQuarter(start, CommonConstant.FIFTEEN, CommonConstant.ONE),
|
||||
DateNewUtil.roundToNearestQuarter(end, CommonConstant.FIFTEEN, CommonConstant.ZERO), DateField.MINUTE, CommonConstant.FIFTEEN);
|
||||
//查询历史值
|
||||
Map<String, BigDecimal> colValMap = query.getColValMap();
|
||||
for (PointCurveSrcCol pointCurveSrcCol : query.getDeviceIdList()) {
|
||||
query.setSrcId(pointCurveSrcCol.getSrcId());
|
||||
List<String> cols = pointCurveSrcCol.getCols();
|
||||
String key = query.getStationId()+"_"+pointCurveSrcCol.getSrcId();
|
||||
String modelName = query.getMap().get(pointCurveSrcCol.getSrcId());
|
||||
for (String col : cols) {
|
||||
query.setCol(col);
|
||||
String tableName = TableUtil.getTableName(query);
|
||||
UpdateTdReq updateTdReq = new UpdateTdReq();
|
||||
updateTdReq.setStart(start.getTime());
|
||||
updateTdReq.setEnd(end.getTime());
|
||||
updateTdReq.setTableName(modelName+"_"+tableName);
|
||||
updateTdReq.setCol(col);
|
||||
List<ResultData> list = deviceComplexMapper.getData(updateTdReq);
|
||||
if(!list.isEmpty()){
|
||||
for (ResultData resultData : list) {
|
||||
if (resultData.getTs() != null) {
|
||||
resultData.setTableName(updateTdReq.getTableName());
|
||||
resultData.setColName(updateTdReq.getCol());
|
||||
String time = DateUtil.format(new Date(resultData.getTs()), CommonConstant.DATE_YMD);
|
||||
BigDecimal val = colValMap.get(time + "_" + key + "_" + col);
|
||||
if(val==null){
|
||||
continue;
|
||||
}
|
||||
resultData.setCol(val);
|
||||
deviceComplexMapper.modifyData(resultData);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
//按照15分钟自动补充值
|
||||
for (DateTime d:times) {
|
||||
ResultData resultData = new ResultData();
|
||||
resultData.setTs(d.getTime());
|
||||
resultData.setTableName(updateTdReq.getTableName());
|
||||
resultData.setColName(updateTdReq.getCol());
|
||||
String time = DateUtil.format(d, CommonConstant.DATE_YMD);
|
||||
BigDecimal val = colValMap.get(time + "_" + key + "_" + col);
|
||||
if(val==null){
|
||||
continue;
|
||||
}
|
||||
resultData.setCol(val);
|
||||
deviceComplexMapper.modifyData(resultData);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Async
|
||||
public void insertDeviceSimple(TdDeviceAddReq device) {
|
||||
deviceSimpleMapper.insertDeviceSimple(device);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Async
|
||||
public void insertDeviceComplex(List<Integer> complexTableList, TdDeviceAddReq device) {
|
||||
String table = device.getTableName();
|
||||
log.info("insertDeviceComplex=====,{}", table);
|
||||
for (Integer complex : complexTableList) {
|
||||
switch (complex) {
|
||||
case 0:
|
||||
log.info("insertDeviceComplex=====,{}", complex);
|
||||
deviceComplexMapper.insertDeviceComplex(device);
|
||||
break;
|
||||
case 1:
|
||||
device.setTableName(table + DataCollectConstant.TABLE_LINK + CommonConstant.ONE);
|
||||
log.info("insertDeviceComplex1=====,{}", complex);
|
||||
deviceComplexMapper.insertDeviceComplex1(device);
|
||||
break;
|
||||
case 2:
|
||||
device.setTableName(table + DataCollectConstant.TABLE_LINK + CommonConstant.TWO);
|
||||
log.info("insertDeviceComplex2=====,{}", complex);
|
||||
deviceComplexMapper.insertDeviceComplex2(device);
|
||||
break;
|
||||
case 3:
|
||||
device.setTableName(table + DataCollectConstant.TABLE_LINK + CommonConstant.THREE);
|
||||
log.info("insertDeviceComplex3=====,{}", complex);
|
||||
deviceComplexMapper.insertDeviceComplex3(device);
|
||||
break;
|
||||
case 4:
|
||||
device.setTableName(table + DataCollectConstant.TABLE_LINK + CommonConstant.FOUR);
|
||||
log.info("insertDeviceComplex4=====,{}", complex);
|
||||
deviceComplexMapper.insertDeviceComplex4(device);
|
||||
break;
|
||||
case 5:
|
||||
device.setTableName(table + DataCollectConstant.TABLE_LINK + CommonConstant.FIVE);
|
||||
log.info("insertDeviceComplex5=====,{}", complex);
|
||||
deviceComplexMapper.insertDeviceComplex5(device);
|
||||
break;
|
||||
case 6:
|
||||
device.setTableName(table + DataCollectConstant.TABLE_LINK + CommonConstant.SIX);
|
||||
log.info("insertDeviceComplex6=====,{}", complex);
|
||||
deviceComplexMapper.insertDeviceComplex6(device);
|
||||
break;
|
||||
case 7:
|
||||
device.setTableName(table + DataCollectConstant.TABLE_LINK + CommonConstant.SEVEN);
|
||||
log.info("insertDeviceComplex7=====,{}", complex);
|
||||
deviceComplexMapper.insertDeviceComplex7(device);
|
||||
break;
|
||||
default:
|
||||
log.info("insertDeviceComplex not match=====,{}", complex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertDynamicSimple(TdDeviceAddReq device) {
|
||||
deviceSimpleMapper.insertDeviceSimpleNew(device);
|
||||
}
|
||||
|
||||
}
|
||||
33
td-service/src/main/java/com/ho/td/util/TableUtil.java
Normal file
33
td-service/src/main/java/com/ho/td/util/TableUtil.java
Normal file
@ -0,0 +1,33 @@
|
||||
package com.ho.td.util;
|
||||
|
||||
import com.ho.common.tools.constant.CommonConstant;
|
||||
import com.ho.datacollect.api.constant.DataCollectConstant;
|
||||
import com.ho.td.api.entity.query.TdBaseTimeQuery;
|
||||
|
||||
public class TableUtil {
|
||||
|
||||
/**
|
||||
* 根据参数获取表名
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
public static String getTableName(TdBaseTimeQuery query) {
|
||||
String colFalg = query.getCol().substring(0, CommonConstant.TWO);
|
||||
String substring = query.getCol().substring(CommonConstant.TWO);
|
||||
int colNumber = Integer.parseInt(substring);
|
||||
int nameSuffix = 0;
|
||||
if (CommonConstant.YX.equals(colFalg)) {
|
||||
nameSuffix = colNumber / CommonConstant.FIVE_HUNDRED_AND_ONE;
|
||||
} else if (CommonConstant.YC.equals(colFalg)) {
|
||||
nameSuffix = colNumber / CommonConstant.THREETHOUSAND;
|
||||
}
|
||||
//将value拼接到表名后面进行查询
|
||||
StringBuffer tableName = new StringBuffer();
|
||||
tableName.append(query.getGroupId()).append(DataCollectConstant.TABLE_LINK)
|
||||
.append(query.getStationId()).append(DataCollectConstant.TABLE_LINK).append(query.getSrcId());
|
||||
if (nameSuffix != CommonConstant.ZERO) {
|
||||
tableName.append(DataCollectConstant.TABLE_LINK).append(nameSuffix);
|
||||
}
|
||||
return tableName.toString();
|
||||
}
|
||||
}
|
||||
60
td-service/src/main/resources/application-dev.yml
Normal file
60
td-service/src/main/resources/application-dev.yml
Normal file
@ -0,0 +1,60 @@
|
||||
server:
|
||||
port: 8013
|
||||
servlet:
|
||||
context-path: /td
|
||||
|
||||
spring:
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
application:
|
||||
name: td-service
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 127.0.0.1:8848
|
||||
datasource:
|
||||
# tdengine-server:
|
||||
# #jdbc-url: jdbc:TAOS://192.168.1.198:6030/test_td_db?user=root&password=taosdata&charset=UTF-8&locale=zh_CN.UTF-8&timezone=UTC-8
|
||||
# jdbc-url: jdbc:TAOS-RS://123.60.64.124:6041/test_td_db?user=root&password=taosdata&charset=UTF-8&locale=zh_CN.UTF-8&timezone=UTC-8
|
||||
# username: root
|
||||
# password: taosdata
|
||||
# type: com.zaxxer.hikari.HikariDataSource # Hikari连接池的设置
|
||||
# minimum-idle: 5 #最小连接
|
||||
# maximum-pool-size: 15 #最大连接
|
||||
# auto-commit: true #自动提交
|
||||
# idle-timeout: 30000 #最大空闲时常
|
||||
# pool-name: TDengineDruidCP #连接池名
|
||||
# max-lifetime: 1800000 #最大生命周期
|
||||
# connection-timeout: 30000 #连接超时时间
|
||||
# connection-test-query: show tables
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
|
||||
url: jdbc:TAOS-RS://1.95.153.121:6041/test_td_db?user=root&password=taosdata&charset=UTF-8&locale=zh_CN.UTF-8&timezone=UTC-8
|
||||
username: root
|
||||
password: taosdata
|
||||
druid:
|
||||
initial-size: 6
|
||||
min-idle: 6
|
||||
max-active: 12
|
||||
max-wait: 10000
|
||||
time-between-eviction-runs-millis: 60000
|
||||
validation-query: SELECT 1 as nums
|
||||
# test-while-idle: true
|
||||
# test-on-borrow: false
|
||||
# test-on-return: false
|
||||
# pool-prepared-statements: true
|
||||
# max-pool-prepared-statement-per-connection-size: 20
|
||||
# connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
|
||||
# filters: stat # 拦截sql的开
|
||||
#Redis
|
||||
redis:
|
||||
port: 6379 #端口
|
||||
timeout: 3000ms #连接超时
|
||||
host: 1.95.153.121 #单机
|
||||
password: zzkj@688737
|
||||
database: 0
|
||||
|
||||
boot:
|
||||
admin:
|
||||
client:
|
||||
url: http://localhost:8019/boot
|
||||
3
td-service/src/main/resources/application.yml
Normal file
3
td-service/src/main/resources/application.yml
Normal file
@ -0,0 +1,3 @@
|
||||
spring:
|
||||
profiles:
|
||||
active: dev
|
||||
41
td-service/src/main/resources/bootstrap.yml
Normal file
41
td-service/src/main/resources/bootstrap.yml
Normal file
@ -0,0 +1,41 @@
|
||||
spring:
|
||||
#禁止servlet懒加载
|
||||
mvc:
|
||||
servlet:
|
||||
load-on-startup: 1
|
||||
|
||||
mybatis:
|
||||
type-aliases-package: com.ho.td.api.entity
|
||||
mapper-locations: classpath:mapper/*.xml
|
||||
configuration:
|
||||
#驼峰
|
||||
mapUnderscoreToCamelCase: true
|
||||
|
||||
#Logging
|
||||
logging:
|
||||
config: classpath:logback.xml
|
||||
level:
|
||||
com.ho.td.mapper: info
|
||||
|
||||
#开放端点用于SpringBoot Admin的监控
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: '*'
|
||||
health:
|
||||
db:
|
||||
enabled: false
|
||||
|
||||
|
||||
#173redeis密码
|
||||
openRedis:
|
||||
host: 124.70.135.173
|
||||
port: 6379
|
||||
pass: rD?vL&/26H
|
||||
|
||||
#183redeis密码
|
||||
openTestRedis:
|
||||
host: 192.168.1.183
|
||||
port: 6379
|
||||
pass: 123456
|
||||
71
td-service/src/main/resources/logback.xml
Normal file
71
td-service/src/main/resources/logback.xml
Normal file
@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE xml>
|
||||
<configuration>
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%date{yyyy-MM-dd HH:mm:ss.SSS,CTT} [%thread] %-5level %logger{36} - %msg%n
|
||||
</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>/home/hocloud/logs/td-service/td-service.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>/home/hocloud/logs/td-service/td-service.%d{yyyy-MM-dd}-%i.log
|
||||
</fileNamePattern>
|
||||
<maxHistory>10</maxHistory>
|
||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||
命名日志文件,例如log-error-2013-12-21.0.log -->
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>256MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%date{yyyy-MM-dd HH:mm:ss.SSS,CTT} [%thread] %-5level %logger{36} - %msg%n
|
||||
</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="errorFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>/home/hocloud/logs/td-service/td-service-error.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>/home/hocloud/logs/td-service/td-service-error.%d{yyyy-MM-dd}-%i.log
|
||||
</fileNamePattern>
|
||||
<maxHistory>10</maxHistory>
|
||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||
命名日志文件,例如log-error-2013-12-21.0.log -->
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>256MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%date{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
|
||||
</pattern>
|
||||
</encoder>
|
||||
<!-- 此filter过滤debug级别以下的日志-->
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>ERROR</level>
|
||||
</filter>
|
||||
<!-- 级别过滤器,根据日志级别进行过滤。-->
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>ERROR</level>
|
||||
<!-- 表示不输出ERROR及以上日志-->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 表示输出ERROR以下日志-->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
|
||||
<!-- project default level -->
|
||||
<logger name="com.ho.td" level="DEBUG"/>
|
||||
|
||||
<!--log4jdbc -->
|
||||
<logger name="jdbc.sqltiming" level="DEBUG"/>
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="console"/>
|
||||
<appender-ref ref="rollingFile"/>
|
||||
<appender-ref ref="errorFile"/>
|
||||
</root>
|
||||
</configuration>
|
||||
27892
td-service/src/main/resources/mapper/DeviceComplex.xml
Normal file
27892
td-service/src/main/resources/mapper/DeviceComplex.xml
Normal file
File diff suppressed because it is too large
Load Diff
1538
td-service/src/main/resources/mapper/DeviceSimple.xml
Normal file
1538
td-service/src/main/resources/mapper/DeviceSimple.xml
Normal file
File diff suppressed because it is too large
Load Diff
4058
td-service/src/main/resources/td_sql/s_device_complex.sql
Normal file
4058
td-service/src/main/resources/td_sql/s_device_complex.sql
Normal file
File diff suppressed because it is too large
Load Diff
3908
td-service/src/main/resources/td_sql/s_device_complex_1.sql
Normal file
3908
td-service/src/main/resources/td_sql/s_device_complex_1.sql
Normal file
File diff suppressed because it is too large
Load Diff
3908
td-service/src/main/resources/td_sql/s_device_complex_2.sql
Normal file
3908
td-service/src/main/resources/td_sql/s_device_complex_2.sql
Normal file
File diff suppressed because it is too large
Load Diff
3908
td-service/src/main/resources/td_sql/s_device_complex_3.sql
Normal file
3908
td-service/src/main/resources/td_sql/s_device_complex_3.sql
Normal file
File diff suppressed because it is too large
Load Diff
3908
td-service/src/main/resources/td_sql/s_device_complex_4.sql
Normal file
3908
td-service/src/main/resources/td_sql/s_device_complex_4.sql
Normal file
File diff suppressed because it is too large
Load Diff
3908
td-service/src/main/resources/td_sql/s_device_complex_5.sql
Normal file
3908
td-service/src/main/resources/td_sql/s_device_complex_5.sql
Normal file
File diff suppressed because it is too large
Load Diff
3908
td-service/src/main/resources/td_sql/s_device_complex_6.sql
Normal file
3908
td-service/src/main/resources/td_sql/s_device_complex_6.sql
Normal file
File diff suppressed because it is too large
Load Diff
3908
td-service/src/main/resources/td_sql/s_device_complex_7.sql
Normal file
3908
td-service/src/main/resources/td_sql/s_device_complex_7.sql
Normal file
File diff suppressed because it is too large
Load Diff
509
td-service/src/main/resources/td_sql/s_device_simple.sql
Normal file
509
td-service/src/main/resources/td_sql/s_device_simple.sql
Normal file
@ -0,0 +1,509 @@
|
||||
drop table s_device_simple;
|
||||
-- 一体机柜简单表
|
||||
|
||||
create stable if not exists s_device_simple
|
||||
(ts timestamp,
|
||||
createTime timestamp,
|
||||
YX0001 int ,
|
||||
YX0002 int ,
|
||||
YX0003 int ,
|
||||
YX0004 int ,
|
||||
YX0005 int ,
|
||||
YX0006 int ,
|
||||
YX0007 int ,
|
||||
YX0008 int ,
|
||||
YX0009 int ,
|
||||
YX0010 int ,
|
||||
YX0011 int ,
|
||||
YX0012 int ,
|
||||
YX0013 int ,
|
||||
YX0014 int ,
|
||||
YX0015 int ,
|
||||
YX0016 int ,
|
||||
YX0017 int ,
|
||||
YX0018 int ,
|
||||
YX0019 int ,
|
||||
YX0020 int ,
|
||||
YX0021 int ,
|
||||
YX0022 int ,
|
||||
YX0023 int ,
|
||||
YX0024 int ,
|
||||
YX0025 int ,
|
||||
YX0026 int ,
|
||||
YX0027 int ,
|
||||
YX0028 int ,
|
||||
YX0029 int ,
|
||||
YX0030 int ,
|
||||
YX0031 int ,
|
||||
YX0032 int ,
|
||||
YX0033 int ,
|
||||
YX0034 int ,
|
||||
YX0035 int ,
|
||||
YX0036 int ,
|
||||
YX0037 int ,
|
||||
YX0038 int ,
|
||||
YX0039 int ,
|
||||
YX0040 int ,
|
||||
YX0041 int ,
|
||||
YX0042 int ,
|
||||
YX0043 int ,
|
||||
YX0044 int ,
|
||||
YX0045 int ,
|
||||
YX0046 int ,
|
||||
YX0047 int ,
|
||||
YX0048 int ,
|
||||
YX0049 int ,
|
||||
YX0050 int ,
|
||||
YX0051 int ,
|
||||
YX0052 int ,
|
||||
YX0053 int ,
|
||||
YX0054 int ,
|
||||
YX0055 int ,
|
||||
YX0056 int ,
|
||||
YX0057 int ,
|
||||
YX0058 int ,
|
||||
YX0059 int ,
|
||||
YX0060 int ,
|
||||
YX0061 int ,
|
||||
YX0062 int ,
|
||||
YX0063 int ,
|
||||
YX0064 int ,
|
||||
YX0065 int ,
|
||||
YX0066 int ,
|
||||
YX0067 int ,
|
||||
YX0068 int ,
|
||||
YX0069 int ,
|
||||
YX0070 int ,
|
||||
YX0071 int ,
|
||||
YX0072 int ,
|
||||
YX0073 int ,
|
||||
YX0074 int ,
|
||||
YX0075 int ,
|
||||
YX0076 int ,
|
||||
YX0077 int ,
|
||||
YX0078 int ,
|
||||
YX0079 int ,
|
||||
YX0080 int ,
|
||||
YX0081 int ,
|
||||
YX0082 int ,
|
||||
YX0083 int ,
|
||||
YX0084 int ,
|
||||
YX0085 int ,
|
||||
YX0086 int ,
|
||||
YX0087 int ,
|
||||
YX0088 int ,
|
||||
YX0089 int ,
|
||||
YX0090 int ,
|
||||
YX0091 int ,
|
||||
YX0092 int ,
|
||||
YX0093 int ,
|
||||
YX0094 int ,
|
||||
YX0095 int ,
|
||||
YX0096 int ,
|
||||
YX0097 int ,
|
||||
YX0098 int ,
|
||||
YX0099 int ,
|
||||
YX0100 int ,
|
||||
YX0101 int ,
|
||||
YX0102 int ,
|
||||
YX0103 int ,
|
||||
YX0104 int ,
|
||||
YX0105 int ,
|
||||
YX0106 int ,
|
||||
YX0107 int ,
|
||||
YX0108 int ,
|
||||
YX0109 int ,
|
||||
YX0110 int ,
|
||||
YX0111 int ,
|
||||
YX0112 int ,
|
||||
YX0113 int ,
|
||||
YX0114 int ,
|
||||
YX0115 int ,
|
||||
YX0116 int ,
|
||||
YX0117 int ,
|
||||
YX0118 int ,
|
||||
YX0119 int ,
|
||||
YX0120 int ,
|
||||
YX0121 int ,
|
||||
YX0122 int ,
|
||||
YX0123 int ,
|
||||
YX0124 int ,
|
||||
YX0125 int ,
|
||||
YX0126 int ,
|
||||
YX0127 int ,
|
||||
YX0128 int ,
|
||||
YX0129 int ,
|
||||
YX0130 int ,
|
||||
YX0131 int ,
|
||||
YX0132 int ,
|
||||
YX0133 int ,
|
||||
YX0134 int ,
|
||||
YX0135 int ,
|
||||
YX0136 int ,
|
||||
YX0137 int ,
|
||||
YX0138 int ,
|
||||
YX0139 int ,
|
||||
YX0140 int ,
|
||||
YX0141 int ,
|
||||
YX0142 int ,
|
||||
YX0143 int ,
|
||||
YX0144 int ,
|
||||
YX0145 int ,
|
||||
YX0146 int ,
|
||||
YX0147 int ,
|
||||
YX0148 int ,
|
||||
YX0149 int ,
|
||||
YX0150 int ,
|
||||
YC0001 float ,
|
||||
YC0002 float ,
|
||||
YC0003 float ,
|
||||
YC0004 float ,
|
||||
YC0005 float ,
|
||||
YC0006 float ,
|
||||
YC0007 float ,
|
||||
YC0008 float ,
|
||||
YC0009 float ,
|
||||
YC0010 float ,
|
||||
YC0011 float ,
|
||||
YC0012 float ,
|
||||
YC0013 float ,
|
||||
YC0014 float ,
|
||||
YC0015 float ,
|
||||
YC0016 float ,
|
||||
YC0017 float ,
|
||||
YC0018 float ,
|
||||
YC0019 float ,
|
||||
YC0020 float ,
|
||||
YC0021 float ,
|
||||
YC0022 float ,
|
||||
YC0023 float ,
|
||||
YC0024 float ,
|
||||
YC0025 float ,
|
||||
YC0026 float ,
|
||||
YC0027 float ,
|
||||
YC0028 float ,
|
||||
YC0029 float ,
|
||||
YC0030 float ,
|
||||
YC0031 float ,
|
||||
YC0032 float ,
|
||||
YC0033 float ,
|
||||
YC0034 float ,
|
||||
YC0035 float ,
|
||||
YC0036 float ,
|
||||
YC0037 float ,
|
||||
YC0038 float ,
|
||||
YC0039 float ,
|
||||
YC0040 float ,
|
||||
YC0041 float ,
|
||||
YC0042 float ,
|
||||
YC0043 float ,
|
||||
YC0044 float ,
|
||||
YC0045 float ,
|
||||
YC0046 float ,
|
||||
YC0047 float ,
|
||||
YC0048 float ,
|
||||
YC0049 float ,
|
||||
YC0050 float ,
|
||||
YC0051 float ,
|
||||
YC0052 float ,
|
||||
YC0053 float ,
|
||||
YC0054 float ,
|
||||
YC0055 float ,
|
||||
YC0056 float ,
|
||||
YC0057 float ,
|
||||
YC0058 float ,
|
||||
YC0059 float ,
|
||||
YC0060 float ,
|
||||
YC0061 float ,
|
||||
YC0062 float ,
|
||||
YC0063 float ,
|
||||
YC0064 float ,
|
||||
YC0065 float ,
|
||||
YC0066 float ,
|
||||
YC0067 float ,
|
||||
YC0068 float ,
|
||||
YC0069 float ,
|
||||
YC0070 float ,
|
||||
YC0071 float ,
|
||||
YC0072 float ,
|
||||
YC0073 float ,
|
||||
YC0074 float ,
|
||||
YC0075 float ,
|
||||
YC0076 float ,
|
||||
YC0077 float ,
|
||||
YC0078 float ,
|
||||
YC0079 float ,
|
||||
YC0080 float ,
|
||||
YC0081 float ,
|
||||
YC0082 float ,
|
||||
YC0083 float ,
|
||||
YC0084 float ,
|
||||
YC0085 float ,
|
||||
YC0086 float ,
|
||||
YC0087 float ,
|
||||
YC0088 float ,
|
||||
YC0089 float ,
|
||||
YC0090 float ,
|
||||
YC0091 float ,
|
||||
YC0092 float ,
|
||||
YC0093 float ,
|
||||
YC0094 float ,
|
||||
YC0095 float ,
|
||||
YC0096 float ,
|
||||
YC0097 float ,
|
||||
YC0098 float ,
|
||||
YC0099 float ,
|
||||
YC0100 float ,
|
||||
YC0101 float ,
|
||||
YC0102 float ,
|
||||
YC0103 float ,
|
||||
YC0104 float ,
|
||||
YC0105 float ,
|
||||
YC0106 float ,
|
||||
YC0107 float ,
|
||||
YC0108 float ,
|
||||
YC0109 float ,
|
||||
YC0110 float ,
|
||||
YC0111 float ,
|
||||
YC0112 float ,
|
||||
YC0113 float ,
|
||||
YC0114 float ,
|
||||
YC0115 float ,
|
||||
YC0116 float ,
|
||||
YC0117 float ,
|
||||
YC0118 float ,
|
||||
YC0119 float ,
|
||||
YC0120 float ,
|
||||
YC0121 float ,
|
||||
YC0122 float ,
|
||||
YC0123 float ,
|
||||
YC0124 float ,
|
||||
YC0125 float ,
|
||||
YC0126 float ,
|
||||
YC0127 float ,
|
||||
YC0128 float ,
|
||||
YC0129 float ,
|
||||
YC0130 float ,
|
||||
YC0131 float ,
|
||||
YC0132 float ,
|
||||
YC0133 float ,
|
||||
YC0134 float ,
|
||||
YC0135 float ,
|
||||
YC0136 float ,
|
||||
YC0137 float ,
|
||||
YC0138 float ,
|
||||
YC0139 float ,
|
||||
YC0140 float ,
|
||||
YC0141 float ,
|
||||
YC0142 float ,
|
||||
YC0143 float ,
|
||||
YC0144 float ,
|
||||
YC0145 float ,
|
||||
YC0146 float ,
|
||||
YC0147 float ,
|
||||
YC0148 float ,
|
||||
YC0149 float ,
|
||||
YC0150 float ,
|
||||
YK0001 int ,
|
||||
YK0002 int ,
|
||||
YK0003 int ,
|
||||
YK0004 int ,
|
||||
YK0005 int ,
|
||||
YK0006 int ,
|
||||
YK0007 int ,
|
||||
YK0008 int ,
|
||||
YK0009 int ,
|
||||
YK0010 int ,
|
||||
YK0011 int ,
|
||||
YK0012 int ,
|
||||
YK0013 int ,
|
||||
YK0014 int ,
|
||||
YK0015 int ,
|
||||
YK0016 int ,
|
||||
YK0017 int ,
|
||||
YK0018 int ,
|
||||
YK0019 int ,
|
||||
YK0020 int ,
|
||||
YK0021 int ,
|
||||
YK0022 int ,
|
||||
YK0023 int ,
|
||||
YK0024 int ,
|
||||
YK0025 int ,
|
||||
YK0026 int ,
|
||||
YK0027 int ,
|
||||
YK0028 int ,
|
||||
YK0029 int ,
|
||||
YK0030 int ,
|
||||
YK0031 int ,
|
||||
YK0032 int ,
|
||||
YK0033 int ,
|
||||
YK0034 int ,
|
||||
YK0035 int ,
|
||||
YK0036 int ,
|
||||
YK0037 int ,
|
||||
YK0038 int ,
|
||||
YK0039 int ,
|
||||
YK0040 int ,
|
||||
YK0041 int ,
|
||||
YK0042 int ,
|
||||
YK0043 int ,
|
||||
YK0044 int ,
|
||||
YK0045 int ,
|
||||
YK0046 int ,
|
||||
YK0047 int ,
|
||||
YK0048 int ,
|
||||
YK0049 int ,
|
||||
YK0050 int ,
|
||||
YK0051 int ,
|
||||
YK0052 int ,
|
||||
YK0053 int ,
|
||||
YK0054 int ,
|
||||
YK0055 int ,
|
||||
YK0056 int ,
|
||||
YK0057 int ,
|
||||
YK0058 int ,
|
||||
YK0059 int ,
|
||||
YK0060 int ,
|
||||
YK0061 int ,
|
||||
YK0062 int ,
|
||||
YK0063 int ,
|
||||
YK0064 int ,
|
||||
YK0065 int ,
|
||||
YK0066 int ,
|
||||
YK0067 int ,
|
||||
YK0068 int ,
|
||||
YK0069 int ,
|
||||
YK0070 int ,
|
||||
YK0071 int ,
|
||||
YK0072 int ,
|
||||
YK0073 int ,
|
||||
YK0074 int ,
|
||||
YK0075 int ,
|
||||
YK0076 int ,
|
||||
YK0077 int ,
|
||||
YK0078 int ,
|
||||
YK0079 int ,
|
||||
YK0080 int ,
|
||||
YK0081 int ,
|
||||
YK0082 int ,
|
||||
YK0083 int ,
|
||||
YK0084 int ,
|
||||
YK0085 int ,
|
||||
YK0086 int ,
|
||||
YK0087 int ,
|
||||
YK0088 int ,
|
||||
YK0089 int ,
|
||||
YK0090 int ,
|
||||
YK0091 int ,
|
||||
YK0092 int ,
|
||||
YK0093 int ,
|
||||
YK0094 int ,
|
||||
YK0095 int ,
|
||||
YK0096 int ,
|
||||
YK0097 int ,
|
||||
YK0098 int ,
|
||||
YK0099 int ,
|
||||
YK0100 int ,
|
||||
YK0101 int ,
|
||||
YK0102 int ,
|
||||
YK0103 int ,
|
||||
YK0104 int ,
|
||||
YK0105 int ,
|
||||
YK0106 int ,
|
||||
YK0107 int ,
|
||||
YK0108 int ,
|
||||
YK0109 int ,
|
||||
YK0110 int ,
|
||||
YK0111 int ,
|
||||
YK0112 int ,
|
||||
YK0113 int ,
|
||||
YK0114 int ,
|
||||
YK0115 int ,
|
||||
YK0116 int ,
|
||||
YK0117 int ,
|
||||
YK0118 int ,
|
||||
YK0119 int ,
|
||||
YK0120 int ,
|
||||
YK0121 int ,
|
||||
YK0122 int ,
|
||||
YK0123 int ,
|
||||
YK0124 int ,
|
||||
YK0125 int ,
|
||||
YK0126 int ,
|
||||
YK0127 int ,
|
||||
YK0128 int ,
|
||||
YK0129 int ,
|
||||
YK0130 int ,
|
||||
YK0131 int ,
|
||||
YK0132 int ,
|
||||
YK0133 int ,
|
||||
YK0134 int ,
|
||||
YK0135 int ,
|
||||
YK0136 int ,
|
||||
YK0137 int ,
|
||||
YK0138 int ,
|
||||
YK0139 int ,
|
||||
YK0140 int ,
|
||||
YK0141 int ,
|
||||
YK0142 int ,
|
||||
YK0143 int ,
|
||||
YK0144 int ,
|
||||
YK0145 int ,
|
||||
YK0146 int ,
|
||||
YK0147 int ,
|
||||
YK0148 int ,
|
||||
YK0149 int ,
|
||||
YK0150 int ,
|
||||
YX0151 float,
|
||||
YX0152 float,
|
||||
YX0153 float,
|
||||
YX0154 float,
|
||||
YX0155 float,
|
||||
YX0156 float,
|
||||
YX0157 float,
|
||||
YX0158 float,
|
||||
YX0159 float,
|
||||
YX0160 float,
|
||||
YX0161 float,
|
||||
YX0162 float,
|
||||
YX0163 float,
|
||||
YX0164 float,
|
||||
YX0165 float,
|
||||
YX0166 float,
|
||||
YX0167 float,
|
||||
YX0168 float,
|
||||
YX0169 float,
|
||||
YX0170 float,
|
||||
YX0171 float,
|
||||
YX0172 float,
|
||||
YX0173 float,
|
||||
YX0174 float,
|
||||
YX0175 float,
|
||||
YX0176 float,
|
||||
YX0177 float,
|
||||
YX0178 float,
|
||||
YX0179 float,
|
||||
YX0180 float,
|
||||
YX0181 float,
|
||||
YX0182 float,
|
||||
YX0183 float,
|
||||
YX0184 float,
|
||||
YX0185 float,
|
||||
YX0186 float,
|
||||
YX0187 float,
|
||||
YX0188 float,
|
||||
YX0189 float,
|
||||
YX0190 float,
|
||||
YX0191 float,
|
||||
YX0192 float,
|
||||
YX0193 float,
|
||||
YX0194 float,
|
||||
YX0195 float,
|
||||
YX0196 float,
|
||||
YX0197 float,
|
||||
YX0198 float,
|
||||
YX0199 float,
|
||||
YX0200 float
|
||||
|
||||
)
|
||||
tags(gid int,stationid int,src int);
|
||||
Reference in New Issue
Block a user