电表整点数据无法导出和查询问题修复

master
FCD 3 weeks ago
parent 636306a70f
commit e7f3458dcc

@ -297,7 +297,6 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
String address = array.getJSONObject(i).getString("Address"); String address = array.getJSONObject(i).getString("Address");
if (address.equals(item.getMonitorId())) { if (address.equals(item.getMonitorId())) {
item.setGlys(getSafeBigDecimal(array.getJSONObject(i), "GLYS")); item.setGlys(getSafeBigDecimal(array.getJSONObject(i), "GLYS"));
item.setZxyg(getSafeBigDecimal(array.getJSONObject(i), "YGGL"));
item.setActivePower(getSafeBigDecimal(array.getJSONObject(i), "YGGL")); item.setActivePower(getSafeBigDecimal(array.getJSONObject(i), "YGGL"));
item.setReactivePower(getSafeBigDecimal(array.getJSONObject(i), "WGGL")); item.setReactivePower(getSafeBigDecimal(array.getJSONObject(i), "WGGL"));
} }
@ -316,6 +315,7 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
for (RecordDnbInstant item : list) { for (RecordDnbInstant item : list) {
String address = array.getJSONObject(i).getString("Address"); String address = array.getJSONObject(i).getString("Address");
if (address.equals(item.getMonitorId())) { if (address.equals(item.getMonitorId())) {
item.setZxyg(getSafeBigDecimal(array.getJSONObject(i), "ZYGDNSZ"));
item.setReactivePower(getSafeBigDecimal(array.getJSONObject(i), "ZYGDN")); item.setReactivePower(getSafeBigDecimal(array.getJSONObject(i), "ZYGDN"));
} }
} }
@ -329,8 +329,8 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
for (RecordDnbInstant item : list) { for (RecordDnbInstant item : list) {
BaseMonitorInfo temp = new BaseMonitorInfo(); BaseMonitorInfo temp = new BaseMonitorInfo();
temp.setConnCode(item.getMonitorId()); temp.setConnCode(item.getMonitorId());
List<BaseMonitorInfo> BaseList = baseMonitorInfoMapper.selectBaseMonitorInfoList(temp); List<BaseMonitorInfo> baseList = baseMonitorInfoMapper.selectBaseMonitorInfoList(temp);
for (BaseMonitorInfo base : BaseList) { for (BaseMonitorInfo base : baseList) {
item.setMonitorId(base.getMonitorId()); item.setMonitorId(base.getMonitorId());
recordDnbInstantMapper.insertRecordDnbInstant(item); recordDnbInstantMapper.insertRecordDnbInstant(item);
} }

@ -179,21 +179,21 @@
order by ert.monitor_id, ert.monitor_name, ert.pointTime order by ert.monitor_id, ert.monitor_name, ert.pointTime
</select> </select>
<select id="datePointDnbList" resultType="java.util.Map"> <select id="datePointDnbList" resultType="com.op.energy.report.domain.ReportPointDnbDTO">
select ert.monitor_id, select ert.monitor_id monitorId,
ert.monitor_name, ert.monitor_name monitorName,
CAST( CASE CAST( CASE
WHEN #{params.timeSub} = 10 THEN ert.pointTime WHEN #{params.timeSub} = 10 THEN ert.pointTime
WHEN #{params.timeSub} = 7 THEN concat(ert.pointTime, '-01') WHEN #{params.timeSub} = 7 THEN concat(ert.pointTime, '-01')
WHEN #{params.timeSub} = 4 THEN concat(ert.pointTime, '-01-01') WHEN #{params.timeSub} = 4 THEN concat(ert.pointTime, '-01-01')
END AS datetime) AS begin_time, END AS datetime) AS beginTime,
CAST( CASE CAST( CASE
WHEN #{params.timeSub} = 10 THEN ert.pointTime WHEN #{params.timeSub} = 10 THEN ert.pointTime
WHEN #{params.timeSub} = 7 THEN EOMONTH(CONVERT(DATE, CONCAT(ert.pointTime, '-01'))) WHEN #{params.timeSub} = 7 THEN EOMONTH(CONVERT(DATE, CONCAT(ert.pointTime, '-01')))
WHEN #{params.timeSub} = 4 THEN EOMONTH(CONVERT(DATE, CONCAT(ert.pointTime, '-12-01'))) WHEN #{params.timeSub} = 4 THEN EOMONTH(CONVERT(DATE, CONCAT(ert.pointTime, '-12-01')))
END AS datetime) AS end_time, END AS datetime) AS endTime,
sum(isnull(ert.expend,0)) expend, sum(isnull(ert.expend,0)) expend,
max(ert.meter_value) meter_value, max(ert.meter_value) meterValue,
max(ert.monitor_addr) address max(ert.monitor_addr) address
from ( from (
select rpd.monitor_id, m.monitor_name, left(CONVERT(VARCHAR(19), rpd.begin_time, 120), #{params.timeSub}) pointTime, rpd.expend, select rpd.monitor_id, m.monitor_name, left(CONVERT(VARCHAR(19), rpd.begin_time, 120), #{params.timeSub}) pointTime, rpd.expend,

Loading…
Cancel
Save