From 7bf883af73bc60deb9b72c0da4bfacdf1cdd7959 Mon Sep 17 00:00:00 2001 From: njcn_dhj <123456> Date: Thu, 7 Jul 2022 16:18:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=EF=BC=9A?= =?UTF-8?q?=E9=92=88=E5=AF=B9=E5=85=AC=E5=85=B1=E7=B1=BB=E7=9A=84=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../influxdb/param/InfluxDBPublicParam.java | 6 ++ .../src/test/java/DataTest.java | 12 +-- .../impl/HistoryResultServiceImpl.java | 79 ++++++++++--------- 3 files changed, 53 insertions(+), 44 deletions(-) diff --git a/pqs-common/common-influxdb/src/main/java/com/njcn/influxdb/param/InfluxDBPublicParam.java b/pqs-common/common-influxdb/src/main/java/com/njcn/influxdb/param/InfluxDBPublicParam.java index 916c0f798..00c492a46 100644 --- a/pqs-common/common-influxdb/src/main/java/com/njcn/influxdb/param/InfluxDBPublicParam.java +++ b/pqs-common/common-influxdb/src/main/java/com/njcn/influxdb/param/InfluxDBPublicParam.java @@ -231,6 +231,12 @@ public interface InfluxDBPublicParam { String OFFLINEMIN = "offlinemin"; + /** + * data表中InfluxDBPublicParam + */ + String VALUETYPE = "value_type"; + + /** * 数据完整性表公共字段 */ diff --git a/pqs-common/common-influxdb/src/test/java/DataTest.java b/pqs-common/common-influxdb/src/test/java/DataTest.java index 490367b4b..d26836310 100644 --- a/pqs-common/common-influxdb/src/test/java/DataTest.java +++ b/pqs-common/common-influxdb/src/test/java/DataTest.java @@ -69,12 +69,14 @@ public class DataTest { //单条数据插入 public static void insert(InfluxDbUtils influxDBUtil) { Map tags = new HashMap<>(); - long time = Long.parseLong("1654141002000"); - tags.put("line_id", "5e467a40023b299070682eb21f2ec9a1"); + long time = Long.parseLong("1654239603000"); + tags.put("dev_id", "6d53a38cc630675dbe7a179c44d9dc3c"); Map fields = new HashMap<>(); - fields.put("due",1440); - fields.put("real",1200); - influxDBUtil.insert("pqs_integrity", tags, fields, time, TimeUnit.MILLISECONDS); +// fields.put("due",1440); +// fields.put("real",1200); + fields.put("onlinemin",1123); + fields.put("offlinemin",377); + influxDBUtil.insert("pqs_onlinerate", tags, fields, time, TimeUnit.MILLISECONDS); // long time = Long.parseLong("1655135328135"); // Map tags = new HashMap<>(); // // tags.put("line_id", "127fad1dcb0077ac2979141b8473a5e4"); diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/HistoryResultServiceImpl.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/HistoryResultServiceImpl.java index beade5525..ad8106d59 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/HistoryResultServiceImpl.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/HistoryResultServiceImpl.java @@ -15,6 +15,7 @@ import com.njcn.harmonic.pojo.vo.EventDetailVO; import com.njcn.harmonic.pojo.vo.HistoryDataResultVO; import com.njcn.harmonic.pojo.vo.QueryResultLimitVO; import com.njcn.harmonic.service.HistoryResultService; +import com.njcn.influxdb.param.InfluxDBPublicParam; import com.njcn.influxdb.utils.InfluxDbUtils; import lombok.AllArgsConstructor; import lombok.SneakyThrows; @@ -192,9 +193,9 @@ public class HistoryResultServiceImpl implements HistoryResultService { LineDetailDataVO lineDetailDataVO = lineFeignClient.getLineDetailData(lineList).getData(); //组装sql语句 StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append(Param.TIME + " >= '").append(startTime).append(Param.START_TIME).append("' and ").append(Param.TIME).append(" <= '").append(endTime).append(Param.END_TIME).append("' and ("); + stringBuilder.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append(InfluxDBPublicParam.START_TIME).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append(InfluxDBPublicParam.END_TIME).append("' and ("); //sql语句 - stringBuilder.append(Param.LINE_ID + "='").append(lineList).append("')"); + stringBuilder.append(InfluxDBPublicParam.LINE_ID + "='").append(lineList).append("')"); String valueTypeName = ""; switch (valueType) { case 1: @@ -213,7 +214,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { break; } if (Integer.parseInt(contion) != 60 || Integer.parseInt(contion) != 61 || Integer.parseInt(contion) != 62) { - stringBuilder.append(" and ").append(Param.VALUETYPE + "='").append(valueTypeName).append("'"); + stringBuilder.append(" and ").append(InfluxDBPublicParam.VALUETYPE + "='").append(valueTypeName).append("'"); } String sql = ""; List phasicType = new ArrayList<>(); @@ -223,7 +224,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 10: //相电压有效值 sql = "SELECT time as time, rms as aValue FROM data_v WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; phasicType.add("A相"); phasicType.add("B相"); phasicType.add("C相"); @@ -233,7 +234,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 11: //线电压有效值 sql = "SELECT time as time, rms_lvr as aValue FROM data_v WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; phasicType.add("AB相"); phasicType.add("BC相"); phasicType.add("CA相"); @@ -243,7 +244,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 12: //电压偏差 sql = "SELECT time as time, vu_dev as aValue FROM data_v WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; topLimit = overlimit.getVoltageDev(); lowerLimit = overlimit.getUvoltageDev(); if (ptType == 0) { @@ -261,7 +262,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 13: //三相电压不平衡度 sql = "SELECT time as time, v_unbalance as aValue FROM data_v WHERE " + stringBuilder.toString() + - " and phasic_type ='T' order by time asc;"; + " and phasic_type ='T' order by time asc tz('Asia/Shanghai');"; topLimit = overlimit.getUbalance(); phasicType.add("三相电压不平衡度"); unit.add("%"); @@ -270,7 +271,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 14: //电压不平衡 sql = "SELECT time as time, v_zero as aValue FROM data_v WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; phasicType.add("零序电压"); phasicType.add("正序电压"); phasicType.add("负序电压"); @@ -282,7 +283,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 15: //电压总谐波畸变率 sql = "SELECT time as time, v_thd as aValue FROM data_v WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; topLimit = overlimit.getUaberrance(); if (ptType == 0) { phasicType.add("A相"); @@ -299,7 +300,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 20: //电流有效值 sql = "SELECT time as time, rms as aValue FROM data_i WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; phasicType.add("A相"); phasicType.add("B相"); phasicType.add("C相"); @@ -309,7 +310,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 21: //电流总畸变率 sql = "SELECT time as time, i_thd as aValue FROM data_i WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; phasicType.add("A相"); phasicType.add("B相"); phasicType.add("C相"); @@ -319,7 +320,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 22: //负序电流 sql = "SELECT time as time, i_neg as aValue FROM data_i WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; topLimit = overlimit.getINeg(); phasicType.add("负序电流"); unit.add("A"); @@ -328,7 +329,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 30: //频率 V9暂时代表Freq sql = "SELECT time as time, freq as aValue FROM data_v WHERE " + stringBuilder.toString() + - " and phasic_type ='T' order by time asc;"; + " and phasic_type ='T' order by time asc tz('Asia/Shanghai');"; topLimit = 50 + overlimit.getFreqDev(); lowerLimit = 50 - overlimit.getFreqDev(); phasicType.add("频率"); @@ -338,7 +339,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 40: //谐波电压含有率 sql = "SELECT time as time, v_" + number + " as aValue FROM data_harmrate_v WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; topLimit = PubUtils.getValueByMethod(overlimit, "getUharm", number); if (ptType == 0) { phasicType.add("A相"); @@ -355,7 +356,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 41: //谐波电流含有率 sql = "SELECT time as time, i_" + number + " as aValue FROM data_harmrate_i WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; phasicType.add("A相"); phasicType.add("B相"); phasicType.add("C相"); @@ -365,7 +366,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 42: //谐波电压幅值 sql = "SELECT time as time, v_" + number + " as aValue FROM data_v WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; if (ptType == 0) { phasicType.add("A相"); phasicType.add("B相"); @@ -385,7 +386,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 43: //谐波电流幅值 sql = "SELECT time as time, i_" + number + " as aValue FROM data_i WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; topLimit = PubUtils.getValueByMethod(overlimit, "getIharm", number); phasicType.add("A相"); phasicType.add("B相"); @@ -396,7 +397,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 44: //谐波电压相角 sql = "SELECT time as time, v_" + number + " as aValue FROM data_harmphasic_v WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; if (ptType == 0) { phasicType.add("A相"); phasicType.add("B相"); @@ -412,7 +413,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 45: //谐波电流相角 sql = "SELECT time as time, i_" + number + " as aValue FROM data_harmphasic_i WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; phasicType.add("A相"); phasicType.add("B相"); phasicType.add("C相"); @@ -422,7 +423,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 46: //间谐波电压含有率 sql = "SELECT time as time, v_" + number + " as aValue FROM data_inharmrate_v WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; topLimit = PubUtils.getValueByMethod(overlimit, "getInuharm", number); if (ptType == 0) { phasicType.add("A相"); @@ -439,7 +440,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 47: //间谐波电流含有率 sql = "SELECT time as time, i_" + number + " as aValue FROM data_inharmrate_i WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; phasicType.add("A相"); phasicType.add("B相"); phasicType.add("C相"); @@ -449,7 +450,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 48: //间谐波电压幅值 sql = "SELECT time as time, v_" + number + " as aValue FROM data_inharm_v WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; targetName = "间谐波电压幅值"; if (ptType == 0) { phasicType.add("A相"); @@ -465,7 +466,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 49: //间谐波电流幅值 sql = "SELECT time as time, i_" + number + " as aValue FROM data_inharm_i WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; phasicType.add("A相"); phasicType.add("B相"); phasicType.add("C相"); @@ -475,7 +476,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 50: //谐波有功功率 sql = "SELECT time as time, p_" + number + " as aValue FROM data_harmpower_p WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; phasicType.add("A相"); phasicType.add("B相"); phasicType.add("C相"); @@ -489,7 +490,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 51: //谐波无功功率 sql = "SELECT time as time, q_" + number + " as aValue FROM data_harmpower_q WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; phasicType.add("A相"); phasicType.add("B相"); phasicType.add("C相"); @@ -503,7 +504,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 52: //谐波视在功率 sql = "SELECT time as time, s_" + number + " as aValue FROM data_harmpower_s WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; phasicType.add("A相"); phasicType.add("B相"); phasicType.add("C相"); @@ -517,7 +518,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 53: //三相有功功率 sql = "SELECT time as time, p as aValue FROM data_harmpower_p WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; phasicType.add("A相"); phasicType.add("B相"); phasicType.add("C相"); @@ -527,7 +528,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 54: //三相无功功率 sql = "SELECT time as time, q as aValue FROM data_harmpower_q WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; phasicType.add("A相"); phasicType.add("B相"); phasicType.add("C相"); @@ -537,7 +538,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 55: //三相视在功率 sql = "SELECT time as time, s as aValue FROM data_harmpower_s WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; phasicType.add("A相"); phasicType.add("B相"); phasicType.add("C相"); @@ -547,7 +548,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 56: //三相总有功功率 sql = "SELECT time as time, p as aValue FROM data_harmpower_p WHERE " + stringBuilder.toString() + - " and phasic_type ='T' order by time asc;"; + " and phasic_type ='T' order by time asc tz('Asia/Shanghai');"; phasicType.add("三相总有功功率"); unit.add("kW"); targetName = "三相总有功功率"; @@ -555,7 +556,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 57: //三相总无功功率 sql = "SELECT time as time, q as aValue FROM data_harmpower_q WHERE " + stringBuilder.toString() + - " and phasic_type ='T' order by time asc;"; + " and phasic_type ='T' order by time asc tz('Asia/Shanghai');"; phasicType.add("三相总无功功率"); unit.add("kVar"); targetName = "三相总无功功率"; @@ -563,7 +564,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 58: //三相总视在功率 sql = "SELECT time as time, s as aValue FROM data_harmpower_s WHERE " + stringBuilder.toString() + - " and phasic_type ='T' order by time asc;"; + " and phasic_type ='T' order by time asc tz('Asia/Shanghai');"; phasicType.add("三相总视在功率"); unit.add("kVA"); targetName = "三相总视在功率"; @@ -571,7 +572,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 59: //视在功率因数 sql = "SELECT time as time, pf as aValue FROM data_harmpower_p WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; phasicType.add("A相"); phasicType.add("B相"); phasicType.add("C相"); @@ -580,7 +581,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 591: //位移功率因数 sql = "SELECT time as time, df as aValue FROM data_harmpower_p WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; phasicType.add("A相"); phasicType.add("B相"); phasicType.add("C相"); @@ -589,21 +590,21 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 592: //总视在功率因数 sql = "SELECT time as time, pf as aValue FROM data_harmpower_p WHERE " + stringBuilder.toString() + - " and phasic_type ='T' order by time asc;"; + " and phasic_type ='T' order by time asc tz('Asia/Shanghai');"; phasicType.add("总视在功率因数"); targetName = "总视在功率因数"; break; case 593: //总位移功率因数 sql = "SELECT time as time, df as aValue FROM data_harmpower_p WHERE " + stringBuilder.toString() + - " and phasic_type ='T' order by time asc;"; + " and phasic_type ='T' order by time asc tz('Asia/Shanghai');"; phasicType.add("总位移功率因数"); targetName = "总位移功率因数"; break; case 61: //长时闪变 sql = "SELECT time as time, plt as aValue FROM data_plt WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; if (ptType == 0) { phasicType.add("A相"); phasicType.add("B相"); @@ -619,7 +620,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 60: //短时闪变 sql = "SELECT time as time, pst as aValue FROM data_flicker WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; topLimit = overlimit.getFlicker(); if (ptType == 0) { phasicType.add("A相"); @@ -635,7 +636,7 @@ public class HistoryResultServiceImpl implements HistoryResultService { case 62: //电压波动 sql = "SELECT time as time, fluc as aValue FROM data_fluc WHERE " + stringBuilder.toString() + - " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc;"; + " and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') group by phasic_type order by time asc tz('Asia/Shanghai');"; if (ptType == 0) { phasicType.add("A相"); phasicType.add("B相");