Commit 3556bf18 authored by chenzhao's avatar chenzhao

增加光伏接口

parent 1c951a58
...@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
...@@ -29,7 +30,7 @@ public class IdxBizPvPointProcessVariableClassificationDto { ...@@ -29,7 +30,7 @@ public class IdxBizPvPointProcessVariableClassificationDto {
private String record; private String record;
@TableField("REC_DATE") @TableField("REC_DATE")
private LocalDateTime recDate; private Date recDate;
@TableField("REC_USER_ID") @TableField("REC_USER_ID")
private String recUserId; private String recUserId;
...@@ -92,7 +93,7 @@ public class IdxBizPvPointProcessVariableClassificationDto { ...@@ -92,7 +93,7 @@ public class IdxBizPvPointProcessVariableClassificationDto {
private String subarray; private String subarray;
@TableField("GATEWAY_ID") @TableField("GATEWAY_ID")
private Integer gatewayId; private String gatewayId;
@ApiModelProperty(value = "点表地址") @ApiModelProperty(value = "点表地址")
@TableField("INDEX_ADDRESS") @TableField("INDEX_ADDRESS")
...@@ -102,4 +103,11 @@ public class IdxBizPvPointProcessVariableClassificationDto { ...@@ -102,4 +103,11 @@ public class IdxBizPvPointProcessVariableClassificationDto {
@TableField("KKS") @TableField("KKS")
private String kks; private String kks;
private Double currentValue;
private String pointOneId;
private String pointTwoId;
private String pointThreeId;
private String analysVariableId;
} }
...@@ -2,12 +2,11 @@ package com.yeejoin.amos.boot.module.jxiop.biz.entity; ...@@ -2,12 +2,11 @@ package com.yeejoin.amos.boot.module.jxiop.biz.entity;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.time.LocalDateTime; import java.util.Date;
/** /**
* *
...@@ -38,7 +37,7 @@ public class IdxBizFanHealthIndex { ...@@ -38,7 +37,7 @@ public class IdxBizFanHealthIndex {
* *
*/ */
@TableField("REC_DATE") @TableField("REC_DATE")
private LocalDateTime recDate; private Date recDate;
/** /**
* *
...@@ -68,7 +67,7 @@ public class IdxBizFanHealthIndex { ...@@ -68,7 +67,7 @@ public class IdxBizFanHealthIndex {
* 分析维度seq * 分析维度seq
*/ */
@TableField("ANALYSIS_OBJ_SEQ") @TableField("ANALYSIS_OBJ_SEQ")
private Integer analysisObjSeq; private String analysisObjSeq;
/** /**
* *
...@@ -98,13 +97,13 @@ public class IdxBizFanHealthIndex { ...@@ -98,13 +97,13 @@ public class IdxBizFanHealthIndex {
* *
*/ */
@TableField("ANALYSIS_START_TIME") @TableField("ANALYSIS_START_TIME")
private LocalDateTime analysisStartTime; private Date analysisStartTime;
/** /**
* *
*/ */
@TableField("ANALYSIS_END_TIME") @TableField("ANALYSIS_END_TIME")
private LocalDateTime analysisEndTime; private Date analysisEndTime;
/** /**
* 片区 * 片区
...@@ -148,4 +147,8 @@ public class IdxBizFanHealthIndex { ...@@ -148,4 +147,8 @@ public class IdxBizFanHealthIndex {
@TableField("INDEX_ADDRESS") @TableField("INDEX_ADDRESS")
private String indexAddress; private String indexAddress;
@TableField("ANOMALY")
private Double ANOMALY;
} }
...@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode; ...@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date;
/** /**
* *
...@@ -39,7 +40,7 @@ public class IdxBizPvHealthIndex{ ...@@ -39,7 +40,7 @@ public class IdxBizPvHealthIndex{
* *
*/ */
@TableField("REC_DATE") @TableField("REC_DATE")
private LocalDateTime recDate; private Date recDate;
/** /**
* *
...@@ -69,7 +70,7 @@ public class IdxBizPvHealthIndex{ ...@@ -69,7 +70,7 @@ public class IdxBizPvHealthIndex{
* 分析维度seq * 分析维度seq
*/ */
@TableField("ANALYSIS_OBJ_SEQ") @TableField("ANALYSIS_OBJ_SEQ")
private Integer analysisObjSeq; private String analysisObjSeq;
/** /**
* *
...@@ -141,7 +142,7 @@ public class IdxBizPvHealthIndex{ ...@@ -141,7 +142,7 @@ public class IdxBizPvHealthIndex{
* 网关ID * 网关ID
*/ */
@TableField("GATEWAY_ID") @TableField("GATEWAY_ID")
private Integer gatewayId; private String gatewayId;
/** /**
* 点表地址 * 点表地址
...@@ -155,4 +156,8 @@ public class IdxBizPvHealthIndex{ ...@@ -155,4 +156,8 @@ public class IdxBizPvHealthIndex{
@TableField("EQUIPMENT_NAME") @TableField("EQUIPMENT_NAME")
private String equipmentName; private String equipmentName;
@TableField("ANOMALY")
private Double ANOMALY;
} }
...@@ -147,6 +147,14 @@ public class IdxBizPvPointVarCentralValue{ ...@@ -147,6 +147,14 @@ public class IdxBizPvPointVarCentralValue{
@TableField("PROCESS3_MIN") @TableField("PROCESS3_MIN")
private Double process3Min; private Double process3Min;
@TableField("PROCESS1_MAX")
private Double process1Max;
/**
*
*/
@TableField("PROCESS1_MIN")
private Double process1Min;
/** /**
* *
*/ */
......
package com.yeejoin.amos.boot.module.jxiop.biz.mapper2; package com.yeejoin.amos.boot.module.jxiop.biz.mapper2;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanPointProcessVariableClassificationDto;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvPointProcessVariableClassificationDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvPointProcessVariableClassification; import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvPointProcessVariableClassification;
import java.util.List; import java.util.List;
...@@ -13,4 +15,7 @@ import java.util.List; ...@@ -13,4 +15,7 @@ import java.util.List;
*/ */
public interface IdxBizPvPointProcessVariableClassificationMapper extends BaseMapper<IdxBizPvPointProcessVariableClassification> { public interface IdxBizPvPointProcessVariableClassificationMapper extends BaseMapper<IdxBizPvPointProcessVariableClassification> {
List<String> gateWayIdListPv(); List<String> gateWayIdListPv();
List<IdxBizPvPointProcessVariableClassificationDto> getInfluxDBData();
} }
...@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments; import com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanPointProcessVariableClassificationDto; import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanPointProcessVariableClassificationDto;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvPointProcessVariableClassificationDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.*; import com.yeejoin.amos.boot.module.jxiop.biz.entity.*;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.*; import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.*;
import com.yeejoin.amos.component.influxdb.InfluxdbUtil; import com.yeejoin.amos.component.influxdb.InfluxdbUtil;
...@@ -16,6 +17,7 @@ import org.elasticsearch.index.query.QueryBuilder; ...@@ -16,6 +17,7 @@ import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate; import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
...@@ -71,9 +73,11 @@ public class CommonServiceImpl { ...@@ -71,9 +73,11 @@ public class CommonServiceImpl {
String gkzxzjskey2; String gkzxzjskey2;
//----------------健康指数值计算相关请求属性配置------------------------ //----------------健康指数值计算相关请求属性配置------------------------
@Value("${jkzsjs.url:80538a37-2c68-431b-9aa1-bcab88d88f9e}") @Value("${jkzsjs.url:aec8ad20-6d63-4f62-99f6-2d71756cacb6}")
String jkzsjsurl; String jkzsjsfjurl;
@Value("${jkzsjs.url:a9a404d4-6ead-440e-9fcb-b95d5a239b10}")
String jkzsgfurl;
// {"tableName": "idx_biz_fan_point_process_variable_classification"} 风机工况变量划分 // {"tableName": "idx_biz_fan_point_process_variable_classification"} 风机工况变量划分
// {"tableName": "idx_biz_pv_point_process_variable_classification"} 光伏工况变量画分 // {"tableName": "idx_biz_pv_point_process_variable_classification"} 光伏工况变量画分
...@@ -89,6 +93,15 @@ public class CommonServiceImpl { ...@@ -89,6 +93,15 @@ public class CommonServiceImpl {
private IdxBizPvPointVarCorrelationMapper idxBizPvPointVarCorrelationMapper; private IdxBizPvPointVarCorrelationMapper idxBizPvPointVarCorrelationMapper;
@Autowired @Autowired
private InfluxdbUtil influxdbUtil; private InfluxdbUtil influxdbUtil;
@Autowired
IdxBizFanHealthIndexServiceImpl idxBizFanHealthIndexService;
@Autowired
IdxBizPvHealthIndexServiceImpl idxBizPvHealthIndexService;
@Autowired
IdxBizFanHealthLevelMapper idxBizFanHealthLevelMapper;
@Autowired
IdxBizPvHealthLevelMapper idxBizPvHealthLevelMapper;
@Autowired @Autowired
private ElasticsearchRestTemplate elasticsearchTemplate; private ElasticsearchRestTemplate elasticsearchTemplate;
...@@ -820,7 +833,7 @@ public class CommonServiceImpl { ...@@ -820,7 +833,7 @@ public class CommonServiceImpl {
} }
// @Scheduled(cron = "0 0/10 * * * ?") // @Scheduled(cron = "0 0/10 * * * ?")
private void healthWarningMinute() { private void healthWarningMinuteByFJ() {
List<IdxBizFanPointProcessVariableClassificationDto> data = idxBizFanPointProcessVariableClassificationMapper.getInfluxDBData(); List<IdxBizFanPointProcessVariableClassificationDto> data = idxBizFanPointProcessVariableClassificationMapper.getInfluxDBData();
Map<String, List<IdxBizFanPointProcessVariableClassificationDto>> maps = data.stream().collect(Collectors.groupingBy(IdxBizFanPointProcessVariableClassificationDto::getGatewayId)); Map<String, List<IdxBizFanPointProcessVariableClassificationDto>> maps = data.stream().collect(Collectors.groupingBy(IdxBizFanPointProcessVariableClassificationDto::getGatewayId));
BoolQueryBuilder boolMustAll = QueryBuilders.boolQuery(); BoolQueryBuilder boolMustAll = QueryBuilders.boolQuery();
...@@ -899,7 +912,169 @@ public class CommonServiceImpl { ...@@ -899,7 +912,169 @@ public class CommonServiceImpl {
logger.info("------------------------------------------开始调用健康指数计算算法开始----------------------------------------"); logger.info("------------------------------------------开始调用健康指数计算算法开始----------------------------------------");
HashMap<String, Object> realParams = new HashMap<>(); HashMap<String, Object> realParams = new HashMap<>();
realParams.put(gkzxzjskey1, values); realParams.put(gkzxzjskey1, values);
String response = HttpUtil.createPost(baseUrl + jkzsjsurl).body(JSON.toJSONString(realParams)).execute().body(); String response = HttpUtil.createPost(baseUrl + jkzsjsfjurl).body(JSON.toJSONString(realParams)).execute().body();
JSONObject result = JSON.parseObject(response).getJSONObject("result");
if (null != result){
JSONObject jsonObject =result .getJSONObject("result1").getJSONObject("rows");
List<JSONObject> jsonObjects = JSON.parseArray(JSON.toJSONString(jsonObject), JSONObject.class);
List<String> ids = new ArrayList<>();
jsonObjects.stream().forEach(e-> ids.add(e.getString("analysisVariableId")));
LambdaQueryWrapper<IdxBizFanPointProcessVariableClassification> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(IdxBizFanPointProcessVariableClassification::getSequenceNbr,ids);
List<IdxBizFanPointProcessVariableClassification> list = idxBizFanPointProcessVariableClassificationMapper.selectList(queryWrapper);
List<IdxBizFanHealthIndex> idxBizFanHealthIndexs = new ArrayList<>();
for (IdxBizFanPointProcessVariableClassification obj : list) {
for (JSONObject object : jsonObjects) {
if (obj.getSequenceNbr().equals(object.getString("analysisVariableId"))){
IdxBizFanHealthIndex idxBizFanHealthIndex = new IdxBizFanHealthIndex();
BeanUtils.copyProperties(idxBizFanHealthIndex,obj);
idxBizFanHealthIndex.setHealthIndex(object.getDouble("indexValue"));
idxBizFanHealthIndex.setAnalysisObjSeq(obj.getSequenceNbr());
idxBizFanHealthIndex.setRecDate(new Date());
//获取健康指数对应等级
LambdaQueryWrapper<IdxBizFanHealthLevel> query = new LambdaQueryWrapper<>();
query.eq(IdxBizFanHealthLevel::getAnalysisObjType,"设备");
query.eq(IdxBizFanHealthLevel::getStatus,obj.getStation());
query.le(IdxBizFanHealthLevel::getGroupLowerLimit,object.getDouble("indexValue"));
query.ge(IdxBizFanHealthLevel::getGroupUpperLimit,object.getDouble("indexValue"));
IdxBizFanHealthLevel idxBizFanHealthLevel = idxBizFanHealthLevelMapper.selectOne(query);
idxBizFanHealthIndex.setHealthLevel(idxBizFanHealthLevel.getHealthLevel());
idxBizFanHealthIndex.setAnalysisType("按时刻");
idxBizFanHealthIndex.setANOMALY(object.getDouble("scoreValue"));
idxBizFanHealthIndexs.add(idxBizFanHealthIndex);
}
}
}
idxBizFanHealthIndexService.saveBatch(idxBizFanHealthIndexs);
}
try {
logger.info("--------------------repsonse: "+response);
logger.info("------------------------------------------调用健康指数计算算法结束----------------------------------------");
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
@Scheduled(cron = "0 0/10 * * * ?")
private void healthWarningMinuteByGF() {
List<IdxBizPvPointProcessVariableClassificationDto> data = idxBizPvPointProcessVariableClassificationMapper.getInfluxDBData();
Map<String, List<IdxBizPvPointProcessVariableClassificationDto>> maps = data.stream().collect(Collectors.groupingBy(IdxBizPvPointProcessVariableClassificationDto::getGatewayId));
BoolQueryBuilder boolMustAll = QueryBuilders.boolQuery();
List<QueryBuilder> should = boolMustAll.should();
for (String s : maps.keySet()) {
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
List<String> address = maps.get(s).stream().map(IdxBizPvPointProcessVariableClassificationDto::getIndexAddress).collect(Collectors.toList());
boolQueryBuilder.must(QueryBuilders.termsQuery("address.keyword", address)).must(QueryBuilders.matchQuery("gatewayId.keyword", s));
should.add(boolQueryBuilder);
}
// 创建查询构造器
NativeSearchQueryBuilder queryBuilder = new NativeSearchQueryBuilder()
//过滤条件
.withQuery(boolMustAll);
List<ESEquipments> equipments = new LinkedList<>();
long totle = 0;
try {
SearchHits<ESEquipments> searchHits = elasticsearchTemplate.search(queryBuilder.build(), ESEquipments.class);
for (SearchHit searchHit : searchHits.getSearchHits()) {
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(searchHit.getContent());
ESEquipments eSAlertCalled = JSONObject.toJavaObject(jsonObject, ESEquipments.class);
equipments.add(eSAlertCalled);
}
totle = searchHits.getTotalHits();
} catch (Exception e) {
// TODO: handle exception
}
for (IdxBizPvPointProcessVariableClassificationDto datum : data) {
for (ESEquipments equipment : equipments) {
if (equipment.getAddress().equals(datum.getIndexAddress()) && equipment.getGatewayId().equals(datum.getGatewayId())){
datum.setCurrentValue(equipment.getValueDouble());
}
}
}
LambdaQueryWrapper<IdxBizPvPointVarCentralValue> wrapper = new LambdaQueryWrapper<>();
List<IdxBizPvPointVarCentralValue> idxBizUhefs = idxBizPvPointVarCentralValueMapper.selectList(wrapper);
List< Map<String, Object>> datas = new ArrayList<>();
Map<String, Map<String, Object>> resultMap = new HashMap<>();
for (IdxBizPvPointVarCentralValue idxBizUhef : idxBizUhefs) {
double value1 = 0.00;
double value2 = 0.00;
double value3 = 0.00;
double value4 = 0.00;
for (IdxBizPvPointProcessVariableClassificationDto datum : data) {
if (idxBizUhef.getProcessPoint1Id().equals(datum.getSequenceNbr())){
value1 = datum.getCurrentValue();
}
if (idxBizUhef.getProcessPoint2Id().equals(datum.getSequenceNbr())) {
value2 = datum.getCurrentValue();
}
if (idxBizUhef.getProcessPoint3Id().equals(datum.getSequenceNbr())) {
value3 = datum.getCurrentValue();
}
if (idxBizUhef.getAnalysisPointId().equals(datum.getSequenceNbr())) {
value4 = datum.getCurrentValue();
}
}
Map<String, Object> map = new HashMap<>();
if (idxBizUhef.getProcess1Min() <= value1 && value1 <= idxBizUhef.getProcess1Max() &&
idxBizUhef.getProcess2Min() <= value2 && value2 <= idxBizUhef.getProcess2Max() &&
idxBizUhef.getProcess3Min() <= value3 && value3 <= idxBizUhef.getProcess3Max()){
map.put("analysisVariable",value4);
map.put("stdDev",idxBizUhef.getAnalysisStdDev());
map.put("centerValue",idxBizUhef.getAnalysisCenterValue());
map.put("analysisVariableId",idxBizUhef.getAnalysisPointId());
resultMap.put(idxBizUhef.getAnalysisPointId(),map);
}
}
Collection<Map<String, Object>> values = resultMap.values();
if (!values.isEmpty()) {
logger.info("------------------------------------------开始调用健康指数计算算法开始----------------------------------------");
HashMap<String, Object> realParams = new HashMap<>();
realParams.put(gkzxzjskey1, values);
String response = HttpUtil.createPost(baseUrl + jkzsgfurl).body(JSON.toJSONString(realParams)).execute().body();
JSONObject result = JSON.parseObject(response).getJSONObject("result");
if (null != result){
JSONObject jsonObject =result .getJSONObject("result1").getJSONObject("rows");
List<JSONObject> jsonObjects = JSON.parseArray(JSON.toJSONString(jsonObject), JSONObject.class);
List<String> ids = new ArrayList<>();
jsonObjects.stream().forEach(e-> ids.add(e.getString("analysisVariableId")));
LambdaQueryWrapper<IdxBizPvPointProcessVariableClassification> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(IdxBizPvPointProcessVariableClassification::getSequenceNbr,ids);
List<IdxBizPvPointProcessVariableClassification> list = idxBizPvPointProcessVariableClassificationMapper.selectList(queryWrapper);
List<IdxBizPvHealthIndex> idxBizPvHealthIndexs = new ArrayList<>();
for (IdxBizPvPointProcessVariableClassification obj : list) {
for (JSONObject object : jsonObjects) {
if (obj.getSequenceNbr().equals(object.getString("analysisVariableId"))){
IdxBizPvHealthIndex idxBizFanHealthIndex = new IdxBizPvHealthIndex();
BeanUtils.copyProperties(idxBizFanHealthIndex,obj);
idxBizFanHealthIndex.setHealthIndex(object.getDouble("indexValue"));
idxBizFanHealthIndex.setAnalysisObjSeq(obj.getSequenceNbr());
idxBizFanHealthIndex.setRecDate(new Date());
//获取健康指数对应等级
LambdaQueryWrapper<IdxBizPvHealthLevel> query = new LambdaQueryWrapper<>();
query.eq(IdxBizPvHealthLevel::getAnalysisObjType,"设备");
query.eq(IdxBizPvHealthLevel::getStatus,obj.getStation());
query.le(IdxBizPvHealthLevel::getGroupLowerLimit,object.getDouble("indexValue"));
query.ge(IdxBizPvHealthLevel::getGroupUpperLimit,object.getDouble("indexValue"));
IdxBizPvHealthLevel idxBizFanHealthLevel = idxBizPvHealthLevelMapper.selectOne(query);
idxBizFanHealthIndex.setHealthLevel(idxBizFanHealthLevel.getHealthLevel());
idxBizFanHealthIndex.setAnalysisType("按时刻");
idxBizFanHealthIndex.setANOMALY(object.getDouble("scoreValue"));
idxBizPvHealthIndexs.add(idxBizFanHealthIndex);
}
}
}
idxBizPvHealthIndexService.saveBatch(idxBizPvHealthIndexs);
}
try { try {
logger.info("--------------------repsonse: " + response); logger.info("--------------------repsonse: " + response);
logger.info("------------------------------------------调用健康指数计算算法结束----------------------------------------"); logger.info("------------------------------------------调用健康指数计算算法结束----------------------------------------");
......
...@@ -4,4 +4,54 @@ ...@@ -4,4 +4,54 @@
<select id="gateWayIdListPv" resultType="java.lang.String"> <select id="gateWayIdListPv" resultType="java.lang.String">
select GATEWAY_ID from idx_biz_pv_point_process_variable_classification group by GATEWAY_ID; select GATEWAY_ID from idx_biz_pv_point_process_variable_classification group by GATEWAY_ID;
</select> </select>
<select id="getInfluxDBData" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvPointProcessVariableClassificationDto">
SELECT b.*,
ibfpvcv.PROCESS_POINT1_ID as pointOneId,
ibfpvcv.PROCESS_POINT2_ID as pointTwoId,
ibfpvcv.PROCESS_POINT3_ID as pointThreeId,
ibfpvcv.ANALYSIS_POINT_ID as pointId
FROM (
SELECT *
FROM idx_biz_pv_point_process_variable_classification uxfv
WHERE uxfv.SEQUENCE_NBR IN (
SELECT PROCESS_POINT1_ID
FROM `idx_biz_pv_point_var_central_value`
WHERE ANALYSIS_POINT_ID IS NOT NULL
GROUP BY ANALYSIS_POINT_ID,
PROCESS_POINT1_ID,
PROCESS_POINT3_ID,
PROCESS_POINT2_ID
UNION ALL
SELECT PROCESS_POINT2_ID
FROM `idx_biz_pv_point_var_central_value`
WHERE ANALYSIS_POINT_ID IS NOT NULL
GROUP BY ANALYSIS_POINT_ID,
PROCESS_POINT1_ID,
PROCESS_POINT3_ID,
PROCESS_POINT2_ID
UNION ALL
SELECT PROCESS_POINT3_ID
FROM `idx_biz_pv_point_var_central_value`
WHERE ANALYSIS_POINT_ID IS NOT NULL
GROUP BY ANALYSIS_POINT_ID,
PROCESS_POINT1_ID,
PROCESS_POINT3_ID,
PROCESS_POINT2_ID
UNION ALL
SELECT ANALYSIS_POINT_ID
FROM `idx_biz_pv_point_var_central_value`
WHERE ANALYSIS_POINT_ID IS NOT NULL
GROUP BY ANALYSIS_POINT_ID,
PROCESS_POINT1_ID,
PROCESS_POINT3_ID,
PROCESS_POINT2_ID
)) AS b,
idx_biz_pv_point_var_central_value ibfpvcv
WHERE b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT1_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT2_ID
OR b.SEQUENCE_NBR = ibfpvcv.PROCESS_POINT3_ID
OR b.SEQUENCE_NBR = ibfpvcv.ANALYSIS_POINT_ID
GROUP BY b.SEQUENCE_NBR
</select>
</mapper> </mapper>
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