历史趋势图调整
This commit is contained in:
@@ -53,6 +53,7 @@ import org.springframework.util.CollectionUtils;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.Instant;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -193,8 +194,53 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
historyDataResultVO.setMaxValue(Collections.max(fValue));
|
||||
historyDataResultVO.setValue(objectListData);
|
||||
} else {
|
||||
//按相别分为3组
|
||||
List<HarmonicHistoryData> aList = harmonicHistoryDataList.stream()
|
||||
//按时间分组
|
||||
Map<Instant,List<HarmonicHistoryData>> map = harmonicHistoryDataList.stream().collect(Collectors.groupingBy(HarmonicHistoryData::getTime,TreeMap::new, Collectors.toList()));
|
||||
|
||||
Float maxI = null;
|
||||
Float minI = null;
|
||||
for (Map.Entry<Instant, List<HarmonicHistoryData>> entry : map.entrySet()) {
|
||||
List<HarmonicHistoryData> val = entry.getValue();
|
||||
Object[] objects = {PubUtils.instantToDate(entry.getKey()),0,0,0};
|
||||
//需要保证val的长度为3
|
||||
if(val.size()!=3){
|
||||
for(int i =0;i<3-val.size();i++){
|
||||
HarmonicHistoryData tem = new HarmonicHistoryData();
|
||||
tem.setAValue(0f);
|
||||
val.add(tem);
|
||||
}
|
||||
}
|
||||
|
||||
for (HarmonicHistoryData harmonicHistoryData : val) {
|
||||
if (InfluxDBTableConstant.PHASE_TYPE_A.equalsIgnoreCase(harmonicHistoryData.getPhasicType())) {
|
||||
|
||||
BigDecimal a = BigDecimal.valueOf(harmonicHistoryData.getAValue()).setScale(4, RoundingMode.HALF_UP);
|
||||
objects[1] =a;
|
||||
maxI = max(maxI, a.floatValue());
|
||||
minI = min(minI, a.floatValue());
|
||||
|
||||
} else if (InfluxDBTableConstant.PHASE_TYPE_B.equalsIgnoreCase(harmonicHistoryData.getPhasicType())) {
|
||||
BigDecimal b = BigDecimal.valueOf(harmonicHistoryData.getAValue()).setScale(4, RoundingMode.HALF_UP);
|
||||
objects[2] = b;
|
||||
maxI = max(maxI, b.floatValue());
|
||||
minI = min(minI, b.floatValue());
|
||||
|
||||
} else if (InfluxDBTableConstant.PHASE_TYPE_C.equalsIgnoreCase(harmonicHistoryData.getPhasicType())) {
|
||||
BigDecimal c = BigDecimal.valueOf(harmonicHistoryData.getAValue()).setScale(4, RoundingMode.HALF_UP);
|
||||
objects[3] = c;
|
||||
maxI = max(maxI, c.floatValue());
|
||||
minI = min(minI, c.floatValue());
|
||||
|
||||
}
|
||||
}
|
||||
List<Object> list = new ArrayList<>(Arrays.asList(objects));
|
||||
|
||||
objectListData.add(list);
|
||||
|
||||
};
|
||||
|
||||
//下面代码稳定后可删除
|
||||
/* List<HarmonicHistoryData> aList = harmonicHistoryDataList.stream()
|
||||
.filter(temp -> temp.getPhasicType().equalsIgnoreCase(InfluxDBTableConstant.PHASE_TYPE_A))
|
||||
.collect(Collectors.toList());
|
||||
List<HarmonicHistoryData> bList = harmonicHistoryDataList.stream()
|
||||
@@ -203,9 +249,23 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
List<HarmonicHistoryData> cList = harmonicHistoryDataList.stream()
|
||||
.filter(temp -> temp.getPhasicType().equalsIgnoreCase(InfluxDBTableConstant.PHASE_TYPE_C))
|
||||
.collect(Collectors.toList());
|
||||
time = aList.stream()
|
||||
.map(temp -> PubUtils.instantToDate(temp.getTime()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
int maxSize = Math.max(aList.size(), Math.max(bList.size(), cList.size()));
|
||||
if (maxSize == aList.size()) {
|
||||
time = aList.stream()
|
||||
.map(temp -> PubUtils.instantToDate(temp.getTime()))
|
||||
.collect(Collectors.toList());
|
||||
} else if (maxSize == bList.size()) {
|
||||
time = bList.stream()
|
||||
.map(temp -> PubUtils.instantToDate(temp.getTime()))
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
time = cList.stream()
|
||||
.map(temp -> PubUtils.instantToDate(temp.getTime()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
aValue = aList.stream()
|
||||
.map(temp -> BigDecimal.valueOf(temp.getAValue()).setScale(4, RoundingMode.HALF_UP).floatValue())
|
||||
.collect(Collectors.toList());
|
||||
@@ -261,8 +321,9 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
.max(Float::compareTo);
|
||||
if (min.isPresent()) {
|
||||
historyDataResultVO.setMaxValue(max.get());
|
||||
}
|
||||
|
||||
}*/
|
||||
historyDataResultVO.setMaxValue(maxI);
|
||||
historyDataResultVO.setMinValue(minI);
|
||||
historyDataResultVO.setTopLimit(queryResultLimitVO.getTopLimit());
|
||||
historyDataResultVO.setLowerLimit(queryResultLimitVO.getLowerLimit());
|
||||
historyDataResultVO.setValue(objectListData);
|
||||
@@ -274,6 +335,27 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
return historyDataResultVO;
|
||||
}
|
||||
|
||||
|
||||
private Float max(Float ding,Float a){
|
||||
if(Objects.isNull(ding)){
|
||||
ding = a;
|
||||
}
|
||||
if(a>ding){
|
||||
ding = a;
|
||||
}
|
||||
return ding;
|
||||
}
|
||||
|
||||
private Float min(Float ding,Float a){
|
||||
if(Objects.isNull(ding)){
|
||||
ding = a;
|
||||
}
|
||||
if(a<ding){
|
||||
ding = a;
|
||||
}
|
||||
return ding;
|
||||
}
|
||||
|
||||
private QueryResultLimitVO getQueryResult(String startTime, String endTime, String lineId, String contion, Integer number, Integer valueType, Integer ptType) {
|
||||
PqsDeviceUnit pqsDeviceUnit = commTerminalGeneralClient.lineUnitDetail(lineId).getData();
|
||||
|
||||
@@ -329,7 +411,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 10:
|
||||
//相电压有效值
|
||||
sql = "SELECT time as time, rms as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_v WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
@@ -339,7 +421,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 11:
|
||||
//线电压有效值
|
||||
sql = "SELECT time as time, rms_lvr as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_v WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C')order by time asc tz('Asia/Shanghai');";
|
||||
phasicType.add("AB相");
|
||||
phasicType.add("BC相");
|
||||
phasicType.add("CA相");
|
||||
@@ -349,7 +431,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 12:
|
||||
//电压偏差
|
||||
sql = "SELECT time as time, vu_dev as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_v WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
topLimit = overlimit.getVoltageDev();
|
||||
lowerLimit = overlimit.getUvoltageDev();
|
||||
if (ptType == 0) {
|
||||
@@ -376,7 +458,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 14:
|
||||
//电压不平衡
|
||||
sql = "SELECT time as time, v_zero as aValue, v_pos as bValue, v_neg as cValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_v WHERE " + stringBuilder +
|
||||
" and (phasic_type ='T') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='T') order by time asc tz('Asia/Shanghai');";
|
||||
phasicType.add("零序电压");
|
||||
phasicType.add("正序电压");
|
||||
phasicType.add("负序电压");
|
||||
@@ -388,7 +470,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 15:
|
||||
//电压总谐波畸变率
|
||||
sql = "SELECT time as time, v_thd as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_v WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
topLimit = overlimit.getUaberrance();
|
||||
if (ptType == 0) {
|
||||
phasicType.add("A相");
|
||||
@@ -405,7 +487,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 20:
|
||||
//电流有效值
|
||||
sql = "SELECT time as time, rms as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_i WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
@@ -415,7 +497,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 21:
|
||||
//电流总畸变率
|
||||
sql = "SELECT time as time, i_thd as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_i WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
@@ -425,7 +507,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 22:
|
||||
//负序电流
|
||||
sql = "SELECT time as time, i_neg as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_i WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
topLimit = overlimit.getINeg();
|
||||
phasicType.add("负序电流");
|
||||
unit.add("A");
|
||||
@@ -445,10 +527,10 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
//谐波电压含有率
|
||||
if (number == 1) {
|
||||
sql = "SELECT time as time, v as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmrate_v WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
} else {
|
||||
sql = "SELECT time as time, v_" + number + " as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmrate_v WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
if (number < 26) {
|
||||
topLimit = PubUtils.getValueByMethod(overlimit, "getUharm", number);
|
||||
}
|
||||
@@ -469,10 +551,10 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
//谐波电流含有率
|
||||
if (number == 1) {
|
||||
sql = "SELECT time as time, i as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmrate_i WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
} else {
|
||||
sql = "SELECT time as time, i_" + number + " as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmrate_i WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
}
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
@@ -484,10 +566,10 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
//谐波电压幅值
|
||||
if (number == 1) {
|
||||
sql = "SELECT time as time, v as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_v WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
} else {
|
||||
sql = "SELECT time as time, v_" + number + " as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_v WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
}
|
||||
if (ptType == 0) {
|
||||
phasicType.add("A相");
|
||||
@@ -509,10 +591,10 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
//谐波电流幅值
|
||||
if (number == 1) {
|
||||
sql = "SELECT time as time, i as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_i WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
} else {
|
||||
sql = "SELECT time as time, i_" + number + " as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_i WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
if (number < 26) {
|
||||
topLimit = PubUtils.getValueByMethod(overlimit, "getIharm", number);
|
||||
}
|
||||
@@ -527,10 +609,10 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
//谐波电压相角
|
||||
if (number == 1) {
|
||||
sql = "SELECT time as time, v as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmphasic_v WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
} else {
|
||||
sql = "SELECT time as time, v_" + number + " as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmphasic_v WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
}
|
||||
if (ptType == 0) {
|
||||
phasicType.add("A相");
|
||||
@@ -548,10 +630,10 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
//谐波电流相角
|
||||
if (number == 1) {
|
||||
sql = "SELECT time as time, i as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmphasic_i WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
} else {
|
||||
sql = "SELECT time as time, i_" + number + " as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmphasic_i WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
}
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
@@ -562,7 +644,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 46:
|
||||
//间谐波电压含有率
|
||||
sql = "SELECT time as time, v_" + number + " as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_inharmrate_v WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
topLimit = PubUtils.getValueByMethod(overlimit, "getInuharm", number);
|
||||
if (ptType == 0) {
|
||||
phasicType.add("A相");
|
||||
@@ -579,7 +661,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 47:
|
||||
//间谐波电流含有率
|
||||
sql = "SELECT time as time, i_" + number + " as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_inharmrate_i WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
@@ -589,7 +671,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 48:
|
||||
//间谐波电压幅值
|
||||
sql = "SELECT time as time, v_" + number + " as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_inharm_v WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
targetName = "间谐波电压幅值";
|
||||
if (ptType == 0) {
|
||||
phasicType.add("A相");
|
||||
@@ -605,7 +687,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 49:
|
||||
//间谐波电流幅值
|
||||
sql = "SELECT time as time, i_" + number + " as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_inharm_i WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
@@ -615,7 +697,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 50:
|
||||
//谐波有功功率
|
||||
sql = "SELECT time as time, p_" + number + " as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmpower_p WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
@@ -629,7 +711,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 51:
|
||||
//谐波无功功率
|
||||
sql = "SELECT time as time, q_" + number + " as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmpower_q WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
@@ -643,7 +725,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 52:
|
||||
//谐波视在功率
|
||||
sql = "SELECT time as time, s_" + number + " as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmpower_s WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
@@ -657,7 +739,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 53:
|
||||
//三相有功功率
|
||||
sql = "SELECT time as time, p as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmpower_p WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
@@ -667,7 +749,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 54:
|
||||
//三相无功功率
|
||||
sql = "SELECT time as time, q as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmpower_q WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
@@ -677,7 +759,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 55:
|
||||
//三相视在功率
|
||||
sql = "SELECT time as time, s as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmpower_s WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
@@ -720,7 +802,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 591:
|
||||
//位移功率因数
|
||||
sql = "SELECT time as time, df as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmpower_p WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
@@ -743,7 +825,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 61:
|
||||
//长时闪变
|
||||
sql = "SELECT time as time, plt as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_plt WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
if (ptType == 0) {
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
@@ -759,7 +841,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 60:
|
||||
//短时闪变
|
||||
sql = "SELECT time as time, pst as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_flicker WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
topLimit = overlimit.getFlicker();
|
||||
if (ptType == 0) {
|
||||
phasicType.add("A相");
|
||||
@@ -775,7 +857,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 62:
|
||||
//电压波动
|
||||
sql = "SELECT time as time, fluc as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_fluc WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
if (ptType == 0) {
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
|
||||
Reference in New Issue
Block a user