Commit 9e487385 authored by caotao's avatar caotao

运行监盘移除influxdb

parent 97650ad9
package com.yeejoin.amos.boot.module.jxiop.biz.constants;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
public class CommonConstans {
//光伏发电量系数
......@@ -12,6 +15,7 @@ public class CommonConstans {
public static final Double pvGenPoweActor = 0.000001;
public static final Double pvGenPoweActorDay = 1.0;
public static final Double pvGenPoweActorYear = 0.0001;
public static final Double pvGenPoweActorCurrentData = 0.0001;
// 风电站:
// (日/月/年)发电量=场站所有风机(日/月/年)发电量总和
// 装机容量=场站所有风机装机容量总和
......@@ -24,16 +28,19 @@ public class CommonConstans {
// 发电量完成率=(月/年)发电量/(月/年)发电量指标
// 小时数完成率=(月/年)可利用小时/(月/年)可利用小时数指标
// 可利用小时(h)=(日/月/年)发电量(万kW·h)/装机容量(万kW)
// 二氧化碳减排量(万t)=发电量(万kW·h)*0.997 * 10 / 10000
public static final Double carbonDioxide = 0.997 * 10 / 10000;
// 节约标准煤(万t)=发电量(万kW·h)*0.29
public static final Double standardCoal = 0.29 / 10000;
// 炭粉尘减排量(t)=发电量(万kW·h)*0.30
public static final Double toner = 0.30;
// 二氧化硫减排量(t)=发电量(万kW·h)*1.51
public static final Double sulfurDioxide = 1.51;
// 氮氧化物减排量(t)=发电量(万kW·h)*1.69
public static final Double oxynitride = 1.69;
// 二氧化碳
public static final Double carbonDioxide = 0.997 * 10;
//标准煤
public static final Double standardCoal = 0.4 * 10;
//炭粉尘减排量
public static final Double toner = 0.272 * 10;
//二氧化硫减排量
public static final Double sulfurDioxide = 0.03 * 10;
//氮氧化物减排量
public static final Double oxynitride = 0.015 * 10;
//千克转吨
public static final Double kgToT = 0.001;
//吨转万吨
public static final Double tToWT = 0.0001;
//万Kwh转MV
......@@ -100,4 +107,9 @@ public class CommonConstans {
public static final String Twodecimalplaces = "%.2f";
public static final String Fourdecimalplaces = "%.4f";
public static final String QueryStringFrontMoudleNotKeyWord = "frontModule";
//泰和的发电量数据
public static final List<String> taiHeGenIndicator = new ArrayList<>(Arrays.asList("泰和日发电量总和", "泰和月发电量总和", "泰和年发电量总和"));
public static final String taiHeGenIndicatorDay = "泰和日发电量总和";
public static final String taiHeGenIndicatorMonth = "泰和月发电量总和";
public static final String taiHeGenIndicatorYear = "泰和年发电量总和";
}
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-system-jxiop</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>amos-boot-module-jxiop-monitor-biz</artifactId>
<version>1.0.0</version>
<name>amos-boot-module-jxiop-monitor-biz</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-common-biz</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-biz-common</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-jxiop-api</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.7.22</version>
</dependency>
<dependency>
<groupId>org.influxdb</groupId>
<artifactId>influxdb-java</artifactId>
</dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-component-influxdb</artifactId>
<version>1.9.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
## DB properties:
## db1-production database
spring.db1.datasource.type: com.alibaba.druid.pool.DruidDataSource
spring.db1.datasource.url=jdbc:mysql://39.98.224.23:3306/production?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db1.datasource.username=root
spring.db1.datasource.password=Yeejoin@2020
spring.db1.datasource.driver-class-name: com.mysql.cj.jdbc.Driver
## db2-sync_data
spring.db2.datasource.type: com.alibaba.druid.pool.DruidDataSource
spring.db2.datasource.url=jdbc:mysql://39.98.224.23:3306/jxiop_sync_data?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db2.datasource.username=root
spring.db2.datasource.password=Yeejoin@2020
spring.db2.datasource.driver-class-name: com.mysql.cj.jdbc.Driver
## eureka properties:
eureka.instance.hostname=172.16.10.220
eureka.client.serviceUrl.defaultZone=http://admin:a1234560@${eureka.instance.hostname}:10001/eureka/
## redis properties:
spring.redis.database=1
spring.redis.host=172.16.10.220
spring.redis.port=6379
spring.redis.password=yeejoin@2020
spring.cache.type=GENERIC
j2cache.open-spring-cache=true
j2cache.cache-clean-mode=passive
j2cache.allow-null-values=true
j2cache.redis-client=lettuce
j2cache.l2-cache-open=true
j2cache.broadcast=net.oschina.j2cache.cache.support.redis.SpringRedisPubSubPolicy
j2cache.L1.provider_class=caffeine
j2cache.L2.provider_class=net.oschina.j2cache.cache.support.redis.SpringRedisProvider
j2cache.L2.config_section=lettuce
j2cache.sync_ttl_to_redis=true
j2cache.default_cache_null_object=false
j2cache.serialization=fst
caffeine.properties=/caffeine.properties
lettuce.mode=single
lettuce.namespace=
lettuce.storage=generic
lettuce.channel=j2cache
lettuce.scheme=redis
lettuce.hosts=${spring.redis.host}:${spring.redis.port}
lettuce.password=${spring.redis.password}
lettuce.database=${spring.redis.database}
lettuce.sentinelMasterId=
lettuce.maxTotal=100
lettuce.maxIdle=10
lettuce.minIdle=10
lettuce.timeout=10000
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.10.220:1883
emqx.user-name=admin
emqx.password=public
mqtt.scene.host=mqtt://172.16.10.220:8083/mqtt
mqtt.client.product.id=mqtt
mqtt.topic=topic_mqtt
spring.mqtt.completionTimeout=3000
emqx.max-inflight=1000
## influxDB
#spring.influx.url= http://172.16.3.155:8186
#spring.influx.password=admin
#spring.influx.user=admin
#spring.influx.database=iot_platform
#spring.influx.retention_policy=default
#spring.influx.retention_policy_time=30d
#spring.influx.actions=10000
#spring.influx.bufferLimit=20000
## influxDB
#spring.influx.url= http://139.9.171.247:8086
#spring.influx.password=Yeejoin@2023
#spring.influx.user=admin
#spring.influx.database=iot_platform
#spring.influx.retention_policy=default
#spring.influx.retention_policy_time=30d
#spring.influx.actions=10000
#spring.influx.bufferLimit=20000
spring.influx.url=http://39.98.224.23:8086
spring.influx.password=Yeejoin@2020
spring.influx.user=root
spring.influx.database=iot_platform
spring.influx.retention_policy=default
spring.influx.retention_policy_time=30d
spring.influx.actions=10000
spring.influx.bufferLimit=20000
knife4j.production=false
knife4j.enable=true
knife4j.basic.enable=true
knife4j.basic.username=admin
knife4j.basic.password=a1234560
management.security.enabled=true
spring.security.user.name=admin
spring.security.user.password=a1234560
fire-rescue=123
mybatis-plus.global-config.db-config.update-strategy=ignored
# user-amos setting : This value is the secretkey for person manage moudle accout password encryption.please don't change it!!!
amos.secret.key=qaz
# if your service can't be access ,you can use this setting , you need change ip as your.
#eureka.instance.prefer-ip-address=true
#eureka.instance.ip-address=172.16.3.122
spring.activemq.broker-url=tcp://139.9.173.44:61616
spring.activemq.user=admin
spring.activemq.password=admin
spring.jms.pub-sub-domain=false
myqueue=amos.privilege.v1.JXIOP.AQSC_FDGL.userBusiness
# ?????????
fan.statuts.stattuspath=upload/jxiop/device_status
pictureUrl=upload/jxiop/syz/
daily.power.generation.cron=0/30 * * * * ?
moon.power.generation.cron=0/30 * * * * ?
year.power.generation.cron=0/30 * * * * ?
spring.application.name=AMOS-JXIOP-MONITOR-cz
server.servlet.context-path=/jxiop-monitor
server.port=33200
server.uri-encoding=UTF-8
spring.profiles.active=dev
spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
logging.config=classpath:logback-${spring.profiles.active}.xml
## mybatis-plus配置控制台打印完整带参数SQL语句
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
### DB properties:
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#spring.datasource.type=com.zaxxer.hikari.HikariDataSource
#spring.datasource.hikari.minimum-idle=10
#spring.datasource.hikari.maximum-pool-size=25
#spring.datasource.hikari.auto-commit=true
#spring.datasource.hikari.idle-timeout=30000
#spring.datasource.hikari.pool-name=DatebookHikariCP
#spring.datasource.hikari.max-lifetime=120000
#spring.datasource.hikari.connection-timeout=30000
#spring.datasource.hikari.connection-test-query=SELECT 1
#JPA Configuration:
spring.jpa.show-sql=false
spring.jpa.open-in-view=true
#spring.jpa.hibernate.ddl-auto=update
spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
##liquibase
spring.liquibase.change-log=classpath:/db/changelog/changelog-master.xml
spring.liquibase.enabled=false
## eureka properties:
#eureka.instance.prefer-ip-address=true
#eureka.instance.ip-address=172.16.3.41
eureka.client.registry-fetch-interval-seconds=5
eureka.instance.health-check-url-path=/actuator/health
eureka.instance.lease-expiration-duration-in-seconds=10
eureka.instance.lease-renewal-interval-in-seconds=5
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url-path=/actuator/info
eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/doc.html
## redis properties:
spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
## redis失效时间
redis.cache.failure.time=10800
spring.servlet.multipart.maxFileSize=100MB
spring.servlet.multipart.maxRequestSize=100MB
spring.main.allow-bean-definition-overriding=true
spring.http.encoding.charset=utf-8
spring.http.encoding.enabled=true
spring.http.encoding.force=true
privilege.fegin.name=AMOS-API-PRIVILEGE
feign.client.config.default.connect-timeout=20000
feign.client.config.default.read-timeout=20000
#场站实时数据
station.task.cron=* * */10 * * ?
#是否切片
station.isok=false
#风机更新数据切片量
station.section=10
gl.sum.column=日发电量,月发电量,年发电量
gl.avg.column=有功功率,日利用小时,瞬时风速
#ES 曲线图定时 0 57 23 * * ?
windSpeed.cron = 0 25 9 * * ?
#本地使用 0 0 5 29 2 ? ? 线上使用 0 */5 * * * ?
windSpeed.Scheduled.cron = 0 0 5 29 2 ?
spring.elasticsearch.rest.uris=http://39.98.224.23:9200
spring.elasticsearch.rest.connection-timeout=30000
spring.elasticsearch.rest.username=elastic
spring.elasticsearch.rest.password=123456
spring.elasticsearch.rest.read-timeout=30000
#elasticsearch.username= elastic
#elasticsearch.password= 123456
\ No newline at end of file
[
{
"euqipmentNumber": "01",
"latitude": "26°19'20.3968",
"longitude": "114°43'01.3487"
},
{
"euqipmentNumber": "02",
"latitude": "26°18'17.3192",
"longitude": "114°43'55.0756"
},
{
"euqipmentNumber": "03",
"latitude": "26°18'34.3219",
"longitude": "114°44'01.4686"
},
{
"euqipmentNumber": "04",
"latitude": "26°18'42.2673",
"longitude": "114°44'10.7522"
},
{
"euqipmentNumber": "05",
"latitude": "26°18'38.0098",
"longitude": "114°44'21.7018"
},
{
"euqipmentNumber": "06",
"latitude": "26°18'34.6466",
"longitude": "114°44'29.9556"
},
{
"euqipmentNumber": "07",
"latitude": "26°18'36.8995",
"longitude": "114°44'39.7470"
},
{
"euqipmentNumber": "08",
"latitude": "26°18'33.5051",
"longitude": "114°44'50.8102"
},
{
"euqipmentNumber": "09",
"longitude": "114°42'38.4597",
"latitude": "26°16'45.3175"
},
{
"euqipmentNumber": "10",
"longitude": "114°42'46.7892",
"latitude": "26°16'34.2193"
},
{
"euqipmentNumber": "11",
"longitude": "114°42'57.3524",
"latitude": "26°16'18.2295"
},
{
"euqipmentNumber": "12",
"longitude": "114°43'44.6453",
"latitude": "26°16'22.9530"
},
{
"euqipmentNumber": "13",
"latitude": "26°16'25.2473",
"longitude": "114°43'55.4240"
},
{
"euqipmentNumber": "14",
"latitude": "26°15'23.8288",
"longitude": "114°42'46.1713"
},
{
"euqipmentNumber": "15",
"latitude": "26°15'18.3501",
"longitude": "114°42'36.4494"
},
{
"euqipmentNumber": "16",
"latitude": "26°15'15.1157",
"longitude": "114°42'24.2207"
},
{
"euqipmentNumber": "17",
"latitude": "26°15'12.3541",
"longitude": "114°42'16.2315"
},
{
"euqipmentNumber": "18",
"latitude": "26°15'07.7590",
"longitude": "114°42'09.1002"
},
{
"euqipmentNumber": "19",
"latitude": "26°15'06.4482",
"longitude": "114°41'59.3730"
},
{
"euqipmentNumber": "20",
"latitude": "26°15'05.7242",
"longitude": "114°41'51.2436"
},
{
"euqipmentNumber": "21",
"latitude": "26°14'54.2353",
"longitude": "114°41'45.1572"
},
{
"euqipmentNumber": "22",
"latitude": "26°14'53.7742",
"longitude": "114°41'35.6931"
},
{
"euqipmentNumber": "23",
"latitude": "26°14'49.6670",
"longitude": "114°41'28.9852"
},
{
"euqipmentNumber": "24",
"latitude": "26°14'52.6637",
"longitude": "114°41'19.3269"
},
{
"euqipmentNumber": "25",
"latitude": "26°14'43.4608",
"longitude": "114°41'12.0974"
},
{
"euqipmentNumber": "26",
"latitude": "26°14'40.3649",
"longitude": "114°41'03.8101"
},
{
"euqipmentNumber": "27",
"latitude": "26°15'33.5730",
"longitude": "114°40'33.7931"
},
{
"euqipmentNumber": "28",
"latitude": "26°15'24.1330",
"longitude": "114°40'51.2196"
},
{
"euqipmentNumber": "29",
"latitude": "26°15'29.4603",
"longitude": "114°40'45.3326"
}
]
\ No newline at end of file
[
{
"code": "iot",
"emqTopic": "emq.iot.created",
"akkaTopic": "JKXT2BP-XFYY-Topic"
},
{
"code": "patrol",
"emqTopic": "emq.patrol.created",
"akkaTopic": "JKXT2BP-XFYY-Topic"
},
{
"code": "sign",
"emqTopic": "emq.sign.created",
"akkaTopic": "JKXT2BP-XFYY-Topic"
},
{
"code": "bussSign",
"emqTopic": "emq.bussSign.created",
"akkaTopic": "JKXT2BP-XFYY-Topic"
},
{
"code": "user",
"emqTopic": "emq.user.created",
"akkaTopic": "JKXT2BP-XFYY-Topic"
},
{
"code": "xf",
"emqTopic": "emq.xf.created",
"akkaTopic": "JKXT2BP-XFYY-Topic"
},
{
"code": "risk",
"emqTopic": "emq.risk.created",
"akkaTopic": "JKXT2BP-XFYY-Topic"
},
{
"code": "patrol",
"emqTopic": "emq.patrol.created",
"akkaTopic": "JKXT2BP-XFYY-Topic"
},
{
"code": "equipQrcode",
"emqTopic": "emq.mcb.zxj",
"akkaTopic": "JKXT2BP-XFYY-Topic"
},
{
"code": "mcbsubmit",
"emqTopic": "risk.submit",
"akkaTopic": "JKXT2BP-XFZX-Topic"
},
{
"code": "question",
"emqTopic": "warning.issue.question.zd",
"akkaTopic": "JKXT2BP-XFZX-Topic"
},
{
"code": "syncExecute",
"emqTopic": "sync.execute",
"akkaTopic": "JKXT2BP-XFZX-Topic"
},
{
"code": "ccsLoginInfo",
"emqTopic": "ccs-user-login-info",
"akkaTopic": "JKXT2BP-XFZX-Topic"
}
]
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<property name="LOG_HOME" value="log" />
<property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %-50.50logger{50} - %msg [%file:%line] %n" />
<!-- 按照每天生成日志文件 -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/ccs.log.%d{yyyy-MM-dd}.log</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>7</MaxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>${LOG_PATTERN}</pattern>
</encoder>
<!--日志文件最大的大小-->
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>30mb</MaxFileSize>
</triggeringPolicy>
</appender>
<!-- 控制台输出 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!--myibatis log configure-->
<logger name="com.apache.ibatis" level="DEBUG"/>
<logger name="java.sql.Connection" level="DEBUG"/>
<logger name="java.sql.Statement" level="DEBUG"/>
<logger name="java.sql.PreparedStatement" level="DEBUG"/>
<logger name="com.baomidou.mybatisplus" level="DEBUG"/>
<logger name="org.springframework" level="DEBUG"/>
<logger name="org.typroject" level="DEBUG"/>
<logger name="com.yeejoin" level="DEBUG"/>
<!-- 日志输出级别 -->
<root level="INFO">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
</root>
</configuration>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.AlarmEventMapper">
<select id="getAlarmEventList" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.AlarmEventDto">
select
station_name as stationName,
event_desc as eventDesc,
alarm_group_name as alarmGroupName,
event_time as eventTime,
(case event_movement
WHEN 'true' then '告警'
WHEN 'false' then '恢复'
ELSE event_movement end ) as eventMovement
from
fault_alarm_event
<where>
<if test="gatewayId != null and gatewayId != ''">
gateway_id = #{gatewayId}
</if>
<if test="stationId != null and stationId != ''">
station_id = #{stationId}
</if>
</where>
order by event_time desc
</select>
<select id="getLastDataBySort" resultType="java.lang.String">
select
sort
from
fault_alarm_event
<where>
<if test="gatewayId != null and gatewayId != ''">
gateway_id = #{gatewayId}
</if>
</where>
order by sort desc limit 1
</select>
<select id="getOldAlarmsBySort" resultType="java.lang.String">
select
event_desc
from
fault_alarm_event
where
gateway_id = #{gatewayId} and sort = #{sort}
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.EquipAlarmEventMapper">
<select id="getLastDataBySort" resultType="java.lang.String">
select
sort
from
equip_alarm_event
<where>
<if test="gatewayId != null and gatewayId != ''">
gateway_id = #{gatewayId}
</if>
</where>
order by sort desc limit 1
</select>
<select id="getOldDataBySort" resultType="com.yeejoin.amos.boot.module.jxiop.biz.entity.EquipAlarmEvent">
select
*
from
equip_alarm_event
<where>
<if test="sort != null and sort != ''">
sort = #{sort}
</if>
AND gateway_id = #{gatewayId}
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SjglZsjZsbtzMapper">
<select id="getStationCapactityByStationWerks" resultType="Double">
select SUM(CAPACITYL) from sjgl_zsj_zsbtz where WERKS = #{WERKS}
</select>
<select id="getStationInfoMapByStationWerks" resultType="map">
SELECT LEFT
( SBMC, 4 ) AS NAME,
GROUP_CONCAT(REPLACE (REPLACE( substring( SBMC, 5 ),'风机系统', '' ) ,"#","" )) as equipNum
FROM
`sjgl_zsj_zsbtz`
WHERE
MACHGENRE = #{DATAID} and WERKS = #{WERKS}
GROUP BY
FSB
</select>
<select id="getStationInfoMapByStationGFWerks" resultType="map">
SELECT LEFT
( b.SBMC, 4 ) AS NAME,
GROUP_CONCAT( REPLACE ( SUBSTRING_INDEX( b.SBMC, "#",- 1 ), '光伏阵区系统', '' ) ) AS equipNum
FROM
(
SELECT
*
FROM
sjgl_zsj_zsbtz
WHERE
FSB IN ( SELECT DBID FROM `sjgl_zsj_zsbtz` WHERE MACHGENRE = ( SELECT DATAID FROM `tpri_dmp_databook` WHERE DATANAME = #{DATAID} ) AND WERKS = #{WERKS} )
) B
GROUP BY
B.FSB
</select>
<select id="getEquipQrcodeInfo" resultType="com.yeejoin.amos.boot.module.jxiop.api.entity.StationQrCodeStatistics">
SELECT
WERKS AS `code`,
count( QRCODE_COLOR = 'red' OR NULL ) AS redNum,
count( QRCODE_COLOR = 'yellow' OR NULL ) AS yellowNum,
count( QRCODE_COLOR = 'green' OR NULL ) AS greenNum,
'equip' AS type,
CURRENT_DATE AS recordDate
FROM
sjgl_zsj_zsbtz
GROUP BY
WERKS
</select>
<select id="getTaskQrcodeInfo" resultType="com.yeejoin.amos.boot.module.jxiop.api.entity.StationQrCodeStatistics">
SELECT
WERKS AS `code`,
count( QRCODE_COLOR = 'red' OR NULL ) AS redNum,
count( QRCODE_COLOR = 'yellow' OR NULL ) AS yellowNum,
count( QRCODE_COLOR = 'green' OR NULL ) AS greenNum,
'job' AS type,
CURRENT_DATE AS recordDate
FROM
fdgl_job_main
GROUP BY
WERKS
</select>
<select id="getEquipYardStatistics" resultType="java.util.Map">
SELECT
a.QRCODE_COLOR as qrCodeColor,
count( 1 ) as value
FROM
sjgl_zsj_zsbtz a
LEFT JOIN privilege_company b on a.WERKS = b.COMPANY_CODE
<where>
<if test="parentCode != null and parentCode != ''">
b.COMPANY_CODE like concat(#{parentCode},'%')
</if>
</where>
GROUP BY
QRCODE_COLOR
</select>
<select id="getJobYardStatistics" resultType="java.util.Map">
SELECT
a.QRCODE_COLOR as qrCodeColor,
count( 1 ) as value
FROM
fdgl_job_main a
LEFT JOIN privilege_company b on a.WERKS = b.COMPANY_CODE
<where>
<if test="parentCode != null and parentCode != ''">
b.COMPANY_CODE like concat(#{parentCode},'%')
</if>
</where>
GROUP BY
QRCODE_COLOR
</select>
<select id="getEquipYardByPage" resultType="java.util.Map">
SELECT
ifnull(a.SBMC, '') as objectName ,
ifnull(a.QRCODE_COLOR, '') AS qrCodeColor,
ifnull(b.COMPANY_NAME, '') AS stationName
FROM
sjgl_zsj_zsbtz a
LEFT JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE
<where>
<if test="parentCode != null and parentCode != ''">
AND b.COMPANY_CODE like concat(#{parentCode},'%')
</if>
</where>
ORDER BY a.CREATE_TIME DESC
limit #{current},#{size}
</select>
<select id="getEquipYardByPageCount" resultType="java.lang.Integer">
SELECT
count(1)
FROM
sjgl_zsj_zsbtz a
LEFT JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE
<where>
<if test="parentCode != null and parentCode != ''">
AND b.COMPANY_CODE like concat(#{parentCode},'%')
</if>
</where>
</select>
<select id="getJobYardByPage" resultType="java.util.Map">
SELECT
ifnull(a.JOB_DESCRIPTION, '') as objectName ,
ifnull(a.qrcode_color, '') AS qrCodeColor,
ifnull(b.COMPANY_NAME, '') AS stationName
FROM
fdgl_job_main a
LEFT JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE
<where>
<if test="parentCode != null and parentCode != ''">
AND b.COMPANY_CODE like concat(#{parentCode},'%')
</if>
</where>
ORDER BY a.CREATE_TIME DESC
limit #{current},#{size}
</select>
<select id="getJobYardByPageCount" resultType="java.lang.Integer">
SELECT
count(1)
FROM
fdgl_job_main a
LEFT JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE
<where>
<if test="parentCode != null and parentCode != ''">
AND b.COMPANY_CODE like concat(#{parentCode},'%')
</if>
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SwitchPictureMapper">
<select id="getSwitchUrl" resultType="com.yeejoin.amos.boot.module.jxiop.biz.entity.SwitchPicture">
select
*
from
switch_picture_url
where
station_id = #{stationId} and switch_num = #{switchNum}
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SystemEnumMapper">
<select id="getStatusMonitoring" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.SystemEnumDto">
SELECT * FROM `system_enum` WHERE type = #{type} and system_name = #{systemName}
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.TemporaryDataMapper">
<select id="timingTemporarysSorageData" resultType="map">
SELECT avg(value) as value ,
created_time as createdTime ,
equipmentIndexName
FROM
`temporary_data`
<where>
<if test="gatewayId != null and gatewayId != ''">
gatewayId = #{gatewayId}
</if>
<if test="gatewayId == null or gatewayId == ''">
equipmentNumber is not null and equipmentIndexName is not null
</if>
</where>
GROUP BY batch_no ,equipmentIndexName;
</select>
<select id="timingTemporarysSorageDataByIndexName" resultType="map">
SELECT avg(value) as value ,
created_time as createdTime ,
equipmentIndexName
FROM
`temporary_data`
<where>
<if test="gatewayId != null and gatewayId != ''">
gatewayId = #{gatewayId}
</if>
<if test="gatewayId == null and gatewayId == ''">
equipmentNumber is not null and equipmentIndexName is not null
</if>
<if test="equipmentIndexName != null and equipmentIndexName != ''">
and equipmentIndexName =#{equipmentIndexName}
</if>
</where>
GROUP BY batch_no ,equipmentIndexName;
</select>
<select id="getStatisticsInfo" resultType="map">
SELECT
avg( VALUE ) AS mean,
( SELECT created_time FROM temporary_data WHERE
equipmentIndexName =#{equipmentIndexName}
<if test="gatewayId != null and gatewayId != ''">
and gatewayId = #{gatewayId}
</if>
ORDER BY `value` LIMIT 1 ) AS minTime,
max( `value` ) AS max,
( SELECT created_time FROM temporary_data WHERE
equipmentIndexName =#{equipmentIndexName}
<if test="gatewayId != null and gatewayId != ''">
and gatewayId = #{gatewayId}
</if> ORDER BY `value` DESC LIMIT 1 ) AS maxTime,
min( `value` ) AS min
FROM
`temporary_data`
<where>
<if test="gatewayId != null and gatewayId != ''">
gatewayId = #{gatewayId} and equipmentIndexName =#{equipmentIndexName}
</if>
<if test="gatewayId == null or gatewayId == ''">
equipmentNumber is not null and equipmentIndexName is not null and equipmentIndexName =#{equipmentIndexName}
</if>
</where>
</select>
<select id="getAllData" resultType="com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESWindSpeed">
SELECT
*
FROM
`temporary_data`
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.TestMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.TpriDmpDatabookMapper">
</mapper>
......@@ -36,23 +36,24 @@
<artifactId>hutool-all</artifactId>
<version>5.7.22</version>
</dependency>
<dependency>
<groupId>org.influxdb</groupId>
<artifactId>influxdb-java</artifactId>
</dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-component-influxdb</artifactId>
<version>1.9.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.influxdb</groupId>-->
<!-- <artifactId>influxdb-java</artifactId>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.yeejoin</groupId>-->
<!-- <artifactId>amos-component-influxdb</artifactId>-->
<!-- <version>1.9.0-SNAPSHOT</version>-->
<!-- <scope>compile</scope>-->
<!-- </dependency>-->
<dependency>
<groupId>com.taosdata.jdbc</groupId>
<artifactId>taos-jdbcdriver</artifactId>
<version>3.2.4</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
......
......@@ -14,8 +14,8 @@ import com.yeejoin.amos.boot.module.jxiop.biz.dto.StationCacheInfoDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.Test;
import com.yeejoin.amos.boot.module.jxiop.biz.repository.ESEquipmentsRepository;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.*;
import com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils;
import com.yeejoin.amos.component.influxdb.InfluxDbConnection;
//import com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils;
//import com.yeejoin.amos.component.influxdb.InfluxDbConnection;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -62,11 +62,11 @@ public class DemoController extends BaseController {
@Autowired
TestServiceImpl testServiceimpl;
@Resource
InfluxDbConnection influxDbConnection;
// @Resource
// InfluxDbConnection influxDbConnection;
@Autowired
InfluxDButils influxDButils;
// @Autowired
// InfluxDButils influxDButils;
@Autowired
EmqKeeper emqKeeper;
......@@ -140,10 +140,10 @@ public class DemoController extends BaseController {
public void demoTest2() {
String sql = "SELECT * FROM indicators_1668801435891929089";
String sql1 = "SELECT * FROM indicators_1668801570352926721";
List<IndicatorsDto> list = influxDButils.getListData(sql, IndicatorsDto.class);
List<IndicatorsDto> list2 = influxDButils.getListData(sql1, IndicatorsDto.class);
System.out.println(list.size());
System.out.println(list2.size());
// List<IndicatorsDto> list = influxDButils.getListData(sql, IndicatorsDto.class);
// List<IndicatorsDto> list2 = influxDButils.getListData(sql1, IndicatorsDto.class);
// System.out.println(list.size());
// System.out.println(list2.size());
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
......@@ -573,7 +573,7 @@ public class DemoController extends BaseController {
// maps2.put("pictureName", monitorFanIndicator.getPictureName());
//升压站的字段显示名称
// maps2.put("displayName", monitorFanIndicator.getEquipmentNumber());
influxDbConnection.insert("indicators_" + monitorFanIndicator.getGateway(), tag, maps2,1688558007051L, TimeUnit.MILLISECONDS);
// influxDbConnection.insert("indicators_" + monitorFanIndicator.getGateway(), tag, maps2,1688558007051L, TimeUnit.MILLISECONDS);
}
}
return ResponseHelper.buildResponse(num);
......
......@@ -9,7 +9,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.dto.ColModel;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.DataGridMock;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.ResultsData;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils;
//import com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
......
......@@ -21,7 +21,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.EquipAlarmEventServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper;
import com.yeejoin.amos.component.influxdb.InfluxdbUtil;
//import com.yeejoin.amos.component.influxdb.InfluxdbUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.eclipse.paho.client.mqttv3.MqttException;
......@@ -77,8 +77,8 @@ public class MonitorFanIdxController extends BaseController {
MonitorFanIndicatorMapper monitorFanIndicatorMapper;
@Autowired
EmqKeeper emqKeeper;
@Autowired
InfluxdbUtil influxdbUtil;
// @Autowired
// InfluxdbUtil influxdbUtil;
@Value("${fan.statuts.stattuspath}")
private String fanStatusImagePathPrefix;
......
......@@ -14,12 +14,12 @@ import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitoringServiceImpl
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.RegionServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.StationBasicServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.TestServiceImpl;
import com.yeejoin.amos.component.influxdb.InfluxDbConnection;
//import com.yeejoin.amos.component.influxdb.InfluxDbConnection;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javafx.scene.control.Tab;
import org.aspectj.apache.bcel.classfile.Module;
import org.influxdb.dto.QueryResult;
//import org.influxdb.dto.QueryResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment