|
|
|
@ -72,7 +72,7 @@
|
|
|
|
|
<if test="pointTime != null and pointTime != ''">and point_time = #{pointTime}</if>
|
|
|
|
|
<if test="monitorSubset != null and monitorSubset != ''">
|
|
|
|
|
and (report_point_dnb.monitor_id = #{monitorSubset} OR report_point_dnb.monitor_id IN
|
|
|
|
|
(SELECT t.monitor_id FROM base_monitor_info t WHERE FIND_IN_SET(#{monitorSubset}, ancestors)))
|
|
|
|
|
(SELECT t.monitor_id FROM base_monitor_info t WHERE dbo.FIND_IN_SET(#{monitorSubset}, ancestors) > 0))
|
|
|
|
|
</if>
|
|
|
|
|
<if test="params.beginBeginTime != null and params.beginBeginTime != '' and params.endBeginTime != null and params.endBeginTime != ''">
|
|
|
|
|
and begin_time between #{params.beginBeginTime} and #{params.endBeginTime}
|
|
|
|
@ -106,7 +106,7 @@
|
|
|
|
|
where report_point_dnb.objid = #{objid}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="energyConsumptionReportByTime" resultType="java.util.Map">
|
|
|
|
|
select ert.pointTime, sum(if(ert.expend is null, 0, ert.expend)) expend
|
|
|
|
|
select ert.pointTime, sum(isnull(ert.expend,0)) expend
|
|
|
|
|
from (
|
|
|
|
|
select left(rpd.begin_time, #{timeSub}) pointTime, rpd.expend
|
|
|
|
|
from report_point_dnb rpd
|
|
|
|
@ -134,7 +134,7 @@
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="energyConsumptionAnalysisDetails" resultType="java.util.Map">
|
|
|
|
|
select ert.monitor_id, ert.monitor_name, ert.pointTime, sum(if(ert.expend is null, 0, ert.expend)) expend
|
|
|
|
|
select ert.monitor_id, ert.monitor_name, ert.pointTime, sum(isnull(ert.expend,0)) expend
|
|
|
|
|
from (
|
|
|
|
|
select rpd.monitor_id, m.monitor_name, left(rpd.begin_time, 10) pointTime, rpd.expend
|
|
|
|
|
from report_point_dnb rpd
|
|
|
|
@ -175,7 +175,7 @@
|
|
|
|
|
WHEN #{params.timeSub} = 7 THEN LAST_DAY(concat(ert.pointTime, '-01'))
|
|
|
|
|
WHEN #{params.timeSub} = 4 THEN LAST_DAY(concat(ert.pointTime, '-12-01'))
|
|
|
|
|
END AS end_time,
|
|
|
|
|
sum(if(ert.expend is null, 0, ert.expend)) expend,
|
|
|
|
|
sum(isnull(ert.expend,0)) expend,
|
|
|
|
|
max(ert.meter_value) meter_value,
|
|
|
|
|
max(ert.monitor_addr) address
|
|
|
|
|
from (
|
|
|
|
@ -190,7 +190,7 @@
|
|
|
|
|
</if>
|
|
|
|
|
<if test="monitorSubset != null and monitorSubset != ''">
|
|
|
|
|
and (rpd.monitor_id = #{monitorSubset} OR rpd.monitor_id IN
|
|
|
|
|
(SELECT t.monitor_id FROM base_monitor_info t WHERE FIND_IN_SET(#{monitorSubset}, ancestors)))
|
|
|
|
|
(SELECT t.monitor_id FROM base_monitor_info t WHERE dbo.FIND_IN_SET(#{monitorSubset}, ancestors) > 0))
|
|
|
|
|
</if>
|
|
|
|
|
<if test="publicShareType != null and publicShareType != ''">and m.public_share_type = #{publicShareType}
|
|
|
|
|
</if>
|
|
|
|
@ -207,7 +207,7 @@
|
|
|
|
|
rpd.monitor_id monitorId,
|
|
|
|
|
m.monitor_name monitorName,
|
|
|
|
|
m.monitor_addr address,
|
|
|
|
|
sum(if(rpd.expend is null, 0, rpd.expend)) expend,
|
|
|
|
|
sum(isnull(ert.expend,0)) expend,
|
|
|
|
|
max(rpd.meter_value) meterValue,
|
|
|
|
|
GROUP_CONCAT(DISTINCT bpu.user_name SEPARATOR ',') owningUser,
|
|
|
|
|
concat(#{beginCollectTime},' 至 ',#{endCollectTime}) timeRange,
|
|
|
|
|