修改达梦sql语句问题
This commit is contained in:
@@ -67,22 +67,22 @@
|
||||
<!--根据监测点索引集合获取监测点详细参数-->
|
||||
<select id="getDetailedParametersForLine" resultType="com.njcn.device.pq.pojo.vo.LineIntegrityDataVO">
|
||||
SELECT
|
||||
line.Id as 'id',
|
||||
line.pid as 'pid',
|
||||
line.Pids as 'pids',
|
||||
line.Name AS 'name',
|
||||
line.Level as 'Level',
|
||||
pd.Update_Time AS 'updateTime',
|
||||
line.Sort as 'sort',
|
||||
pd.Com_Flag as 'ComFlag',
|
||||
sdd.Name AS 'LineScale',
|
||||
device.Name AS 'deviceName',
|
||||
pd.IP AS 'ip',
|
||||
msdd.Name AS 'manufacturer',
|
||||
pldsdd.Name AS 'lineGradeName',
|
||||
pldsdd.id AS 'lineGrade',
|
||||
line.Id as id,
|
||||
line.pid as pid,
|
||||
line.Pids as pids,
|
||||
line.Name AS name,
|
||||
line.Level as Level,
|
||||
pd.Update_Time AS updateTime,
|
||||
line.Sort as sort,
|
||||
pd.Com_Flag as ComFlag,
|
||||
sdd.Name AS LineScale,
|
||||
device.Name AS deviceName,
|
||||
pd.IP AS ip,
|
||||
msdd.Name AS manufacturer,
|
||||
pldsdd.Name AS lineGradeName,
|
||||
pldsdd.id AS lineGrade,
|
||||
pldsdd.Algo_Describe AS algoDescribe,
|
||||
pld.Load_Type AS 'loadType'
|
||||
pld.Load_Type AS loadType
|
||||
FROM
|
||||
pq_line AS line
|
||||
LEFT JOIN pq_line AS voltage ON line.Pid = voltage.Id
|
||||
|
||||
@@ -129,20 +129,20 @@
|
||||
<!--根据监测点索引集合获取监测点详细参数-->
|
||||
<select id="getDetailedParametersForLine" resultType="com.njcn.device.pq.pojo.vo.TerminalOnlineRateDataVO">
|
||||
SELECT
|
||||
line.Id as 'id',
|
||||
line.pid as 'pid',
|
||||
line.Pids as 'pids',
|
||||
line.Name AS 'name',
|
||||
line.Levelas 'Level',
|
||||
line.Update_Time AS 'updateTime',
|
||||
line.Sort as 'sort',
|
||||
pd.Call_Flag as 'ComFlag',
|
||||
sdd.Name AS 'LineScale',
|
||||
device.Name AS 'deviceName',
|
||||
pd.IP AS 'ip',
|
||||
msdd.Name AS 'manufacturer',
|
||||
pldsdd.Name AS 'lineGrade',
|
||||
pld.Load_Type AS 'loadType'
|
||||
line.Id as id,
|
||||
line.pid as pid,
|
||||
line.Pids as pids,
|
||||
line.Name AS name,
|
||||
line.Levelas Level,
|
||||
line.Update_Time AS updateTime,
|
||||
line.Sort as sort,
|
||||
pd.Call_Flag as ComFlag,
|
||||
sdd.Name AS LineScale,
|
||||
device.Name AS deviceName,
|
||||
pd.IP AS ip,
|
||||
msdd.Name AS manufacturer,
|
||||
pldsdd.Name AS lineGrade,
|
||||
pld.Load_Type AS loadType
|
||||
FROM
|
||||
pq_line AS line
|
||||
LEFT JOIN pq_line AS voltage ON line.Pid = voltage.Id
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
</resultMap>
|
||||
<select id="getStatSubstationIcon" resultType="com.njcn.event.pojo.vo.RVoltageIconVO">
|
||||
SELECT
|
||||
substation_voltage as 'substationVoltage',
|
||||
sum( substation_count ) as 'substationCount',
|
||||
sum( event_count ) as 'harmonicCount'
|
||||
substation_voltage as substationVoltage,
|
||||
sum( substation_count ) as substationCount,
|
||||
sum( event_count ) as harmonicCount
|
||||
FROM
|
||||
r_stat_substation_voltage_m
|
||||
<where>
|
||||
|
||||
@@ -51,14 +51,14 @@
|
||||
SELECT
|
||||
substation_id,
|
||||
effective_measurement_accrued,
|
||||
IFNULL( ROUND( freq_over_day / freq_count, 2 ), 0 ) AS 'freqAverageOverDay',
|
||||
IFNULL( ROUND( v_dev_over_day / v_dev_count, 2 ), 0 ) AS 'vDevAverageOverDay',
|
||||
IFNULL( ROUND( v_over_day / v_count, 2 ), 0 ) AS 'vAverageOverDay',
|
||||
IFNULL( ROUND( i_over_day / i_count, 2 ), 0 ) AS 'iAverageOverDay',
|
||||
IFNULL( ROUND( unbalance_over_day / unbalance_count, 2 ), 0 ) AS 'unbalanceAverageOverDay',
|
||||
IFNULL( ROUND( i_neg_over_day / i_neg_count, 2 ), 0 ) AS 'iNegAverageOverDay',
|
||||
IFNULL( ROUND( flicker_over_day / flicker_count, 2 ), 0 ) AS 'flickerAverageOverDay',
|
||||
IFNULL( ROUND( inuharm_over_day / inuharm_count, 2 ), 0 ) AS 'inuharmAverageOverDay'
|
||||
IFNULL( ROUND( freq_over_day / freq_count, 2 ), 0 ) AS freqAverageOverDay,
|
||||
IFNULL( ROUND( v_dev_over_day / v_dev_count, 2 ), 0 ) AS vDevAverageOverDay,
|
||||
IFNULL( ROUND( v_over_day / v_count, 2 ), 0 ) AS vAverageOverDay,
|
||||
IFNULL( ROUND( i_over_day / i_count, 2 ), 0 ) AS iAverageOverDay,
|
||||
IFNULL( ROUND( unbalance_over_day / unbalance_count, 2 ), 0 ) AS unbalanceAverageOverDay,
|
||||
IFNULL( ROUND( i_neg_over_day / i_neg_count, 2 ), 0 ) AS iNegAverageOverDay,
|
||||
IFNULL( ROUND( flicker_over_day / flicker_count, 2 ), 0 ) AS flickerAverageOverDay,
|
||||
IFNULL( ROUND( inuharm_over_day / inuharm_count, 2 ), 0 ) AS inuharmAverageOverDay
|
||||
FROM
|
||||
r_stat_substation_m
|
||||
<where>
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
|
||||
<select id="getStatSubstationIcon" resultType="com.njcn.harmonic.pojo.vo.RVoltageIconVO">
|
||||
SELECT
|
||||
substation_voltage as 'substationVoltage',
|
||||
sum( substation_count ) as 'substationCount',
|
||||
sum( harmonic_count ) as 'harmonicCount'
|
||||
substation_voltage as substationVoltage,
|
||||
sum( substation_count ) as substationCount,
|
||||
sum( harmonic_count ) as harmonicCount
|
||||
FROM
|
||||
r_stat_substation_voltage_m
|
||||
<where>
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.harmonic.service.activepowerrange.impl;
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
@@ -108,7 +109,7 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
||||
LineCountEvaluateParam lineCountEvaluateParam = new LineCountEvaluateParam();
|
||||
lineCountEvaluateParam.setLineId(Collections.singletonList(rActivePowerRangePO.getLineId()));
|
||||
lineCountEvaluateParam.setStartTime(powerStatisticsParam.getSearchBeginTime());
|
||||
lineCountEvaluateParam.setEndTime(powerStatisticsParam.getSearchBeginTime());
|
||||
lineCountEvaluateParam.setEndTime(powerStatisticsParam.getSearchEndTime());
|
||||
//获取超标数据
|
||||
List<DataLimitRateDetailTimeDto> dtoList = dataLimitRateDetailFeignClient.getLimitRateDetailTimeList(lineCountEvaluateParam).getData();
|
||||
Map<String, DataLimitRateDetailTimeDto> timeDateMap = dtoList.stream().collect(Collectors.toMap(x -> x.getTime(), Function.identity()));
|
||||
@@ -125,13 +126,13 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
||||
vo.setTime(t);
|
||||
if (timeDateMap.containsKey(date)) {
|
||||
DataLimitRateDetailTimeDto rateDetail = timeDateMap.get(date);
|
||||
vo.setVoltageOffset(isCross(t, rateDetail.getVoltageDevOvertime()));
|
||||
vo.setSequenceCurrentUnbalance(isCross(t, rateDetail.getINegOvertime()));
|
||||
vo.setUbalance(isCross(t, rateDetail.getUbalanceOvertime()));
|
||||
vo.setFlicker(isCross(t, rateDetail.getFlickerOvertime()));
|
||||
vo.setVTimes(isCross(t, rateDetail.getUharmOvertime()));
|
||||
vo.setITimes(isCross(t, rateDetail.getIharmOvertime()));
|
||||
vo.setInterHarmonic(isCross(t, rateDetail.getInuharmOvertime()));
|
||||
vo.setVoltageOffset(isCross(time, rateDetail.getVoltageDevOvertime()));
|
||||
vo.setSequenceCurrentUnbalance(isCross(time, rateDetail.getINegOvertime()));
|
||||
vo.setUbalance(isCross(time, rateDetail.getUbalanceOvertime()));
|
||||
vo.setFlicker(isCross(time, rateDetail.getFlickerOvertime()));
|
||||
vo.setVTimes(isCross(time, rateDetail.getUharmOvertime()));
|
||||
vo.setITimes(isCross(time, rateDetail.getIharmOvertime()));
|
||||
vo.setInterHarmonic(isCross(time, rateDetail.getInuharmOvertime()));
|
||||
}
|
||||
record.add(vo);
|
||||
}
|
||||
@@ -260,7 +261,7 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
||||
Class clazz = dto.getClass();
|
||||
Field field = clazz.getDeclaredField(split[0]);
|
||||
field.setAccessible(true);
|
||||
field.set(dto, split[1]);
|
||||
field.set(dto, NumberUtil.round(split[1],4)+"");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -277,11 +278,15 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
||||
if (ObjectUtil.isNotNull(o)) {
|
||||
Field phasicType = clazz.getDeclaredField("phasicType");
|
||||
phasicType.setAccessible(true);
|
||||
String phasic = phasicType.get(dto).toString();
|
||||
String phasic = phasicType.get(dto)+"";
|
||||
Field valueType = clazz.getDeclaredField("valueType");
|
||||
valueType.setAccessible(true);
|
||||
String value = valueType.get(dto).toString();
|
||||
return value.toUpperCase() + "Phase" + phasic + "&" + o;
|
||||
Object value = valueType.get(dto);
|
||||
if(ObjectUtil.isNotNull(value)){
|
||||
return value.toString().toUpperCase() + "Phase" + phasic + "&" + o;
|
||||
}else{
|
||||
return "AVGPhase" + phasic + "&" + o;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
</select>
|
||||
<select id="getMemoInfo" resultType="java.lang.Float">
|
||||
SELECT
|
||||
TRUNCATE (data_length / 1024 / 1024, 2) AS '数据容量(MB)'
|
||||
TRUNCATE (data_length / 1024 / 1024, 2) AS 数据容量(MB)
|
||||
FROM
|
||||
information_schema.tables
|
||||
where table_schema = #{schema} and table_name="sys_user_log"
|
||||
|
||||
Reference in New Issue
Block a user