|
|
|
@ -121,7 +121,7 @@
|
|
|
|
|
<select id="energyConsumptionReportByTime" resultType="java.util.Map">
|
|
|
|
|
select ert.pointTime, sum(isnull(ert.expend,0)) expend
|
|
|
|
|
from (
|
|
|
|
|
select left(rpd.begin_time, #{timeSub}) pointTime, rpd.expend
|
|
|
|
|
select left(CONVERT(VARCHAR(17), rpd.begin_time, 120), #{timeSub}) pointTime, rpd.expend
|
|
|
|
|
from report_point_dnb rpd
|
|
|
|
|
left join base_monitor_info m on m.monitor_id = rpd.monitor_id
|
|
|
|
|
<where>
|
|
|
|
@ -138,7 +138,7 @@
|
|
|
|
|
and rpd.begin_time between #{startTime} and #{endTime}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="startDay != null and startDay != '' and endDay != null and endDay != ''">
|
|
|
|
|
and left(rpd.begin_time, 10) between #{startDay} and #{endDay}
|
|
|
|
|
and left(CONVERT(VARCHAR(17), rpd.begin_time, 120), 10) between #{startDay} and #{endDay}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
) ert
|
|
|
|
@ -149,7 +149,7 @@
|
|
|
|
|
<select id="energyConsumptionAnalysisDetails" resultType="java.util.Map">
|
|
|
|
|
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
|
|
|
|
|
select rpd.monitor_id, m.monitor_name, left(CONVERT(VARCHAR(17), rpd.begin_time, 120), 10) pointTime, rpd.expend
|
|
|
|
|
from report_point_dnb rpd
|
|
|
|
|
left join base_monitor_info m on m.monitor_id = rpd.monitor_id
|
|
|
|
|
<where>
|
|
|
|
@ -167,7 +167,7 @@
|
|
|
|
|
<!-- and rpd.begin_time between #{params.beginCollectTime} and #{params.endCollectTime}-->
|
|
|
|
|
<!-- </if>-->
|
|
|
|
|
<if test="startDay != null and startDay != '' and endDay != null and endDay != ''">
|
|
|
|
|
and left(rpd.begin_time, 10) between #{startDay} and #{endDay}
|
|
|
|
|
and left(CONVERT(VARCHAR(17), rpd.begin_time, 120), 10) between #{startDay} and #{endDay}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
) ert
|
|
|
|
@ -178,21 +178,21 @@
|
|
|
|
|
<select id="datePointDnbList" parameterType="ReportPointDnb" resultMap="ReportPointDnbDTOResult">
|
|
|
|
|
select ert.monitor_id,
|
|
|
|
|
ert.monitor_name,
|
|
|
|
|
CASE
|
|
|
|
|
CAST( CASE
|
|
|
|
|
WHEN #{params.timeSub} = 10 THEN ert.pointTime
|
|
|
|
|
WHEN #{params.timeSub} = 7 THEN concat(ert.pointTime, '-01')
|
|
|
|
|
WHEN #{params.timeSub} = 4 THEN concat(ert.pointTime, '-01-01')
|
|
|
|
|
END AS begin_time,
|
|
|
|
|
CASE
|
|
|
|
|
END AS datetime) AS begin_time,
|
|
|
|
|
CAST( CASE
|
|
|
|
|
WHEN #{params.timeSub} = 10 THEN ert.pointTime
|
|
|
|
|
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,
|
|
|
|
|
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')))
|
|
|
|
|
END AS datetime) AS end_time,
|
|
|
|
|
sum(isnull(ert.expend,0)) expend,
|
|
|
|
|
max(ert.meter_value) meter_value,
|
|
|
|
|
max(ert.monitor_addr) address
|
|
|
|
|
from (
|
|
|
|
|
select rpd.monitor_id, m.monitor_name, left(rpd.begin_time, #{params.timeSub}) pointTime, rpd.expend,
|
|
|
|
|
select rpd.monitor_id, m.monitor_name, left(CONVERT(VARCHAR(17), rpd.begin_time, 120), #{params.timeSub}) pointTime, rpd.expend,
|
|
|
|
|
rpd.meter_value,m.monitor_addr
|
|
|
|
|
from report_point_dnb rpd
|
|
|
|
|
left join base_monitor_info m on m.monitor_id = rpd.monitor_id
|
|
|
|
@ -243,7 +243,7 @@
|
|
|
|
|
left join base_public_user bpu on bmp.public_share_id = bpu.id
|
|
|
|
|
<where>
|
|
|
|
|
<if test="beginCollectTime != null and beginCollectTime != '' and endCollectTime != null and endCollectTime != ''">
|
|
|
|
|
and left(rpd.begin_time,10) between #{beginCollectTime} and #{endCollectTime}
|
|
|
|
|
and left(CONVERT(VARCHAR(17), rpd.begin_time, 120)e,10) between #{beginCollectTime} and #{endCollectTime}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="monitorIdList != null and monitorIdList.size > 0">
|
|
|
|
|
and rpd.monitor_id IN
|
|
|
|
|