|
|
|
@ -105,7 +105,7 @@ |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
and cpm.grade = 40 |
|
|
|
and cpm.grade = 40 |
|
|
|
-- and cpm.terminal_device_type = '15' |
|
|
|
and cpm.terminal_device_type = '15' |
|
|
|
) |
|
|
|
) |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
GROUP BY device_type, TO_CHAR(cur_time, 'YYYY-MM-DD HH24:MI:SS'), EXTRACT(YEAR FROM cur_time) |
|
|
|
GROUP BY device_type, TO_CHAR(cur_time, 'YYYY-MM-DD HH24:MI:SS'), EXTRACT(YEAR FROM cur_time) |
|
|
|
@ -143,7 +143,7 @@ |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
and cpm.grade = 40 |
|
|
|
and cpm.grade = 40 |
|
|
|
-- and cpm.terminal_device_type = '15' |
|
|
|
and cpm.terminal_device_type = '15' |
|
|
|
) |
|
|
|
) |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
GROUP BY device_type, TO_CHAR(cur_time, 'YYYY-MM-DD HH24:MI:SS'), EXTRACT(YEAR FROM cur_time) |
|
|
|
GROUP BY device_type, TO_CHAR(cur_time, 'YYYY-MM-DD HH24:MI:SS'), EXTRACT(YEAR FROM cur_time) |
|
|
|
@ -180,7 +180,7 @@ |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
and cpm.grade = 40 |
|
|
|
and cpm.grade = 40 |
|
|
|
-- and cpm.terminal_device_type = '15' |
|
|
|
and cpm.terminal_device_type = '15' |
|
|
|
) |
|
|
|
) |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
GROUP BY device_type, TO_CHAR(cur_time, 'YYYY-MM-DD HH24:MI:SS'), EXTRACT(YEAR FROM cur_time) |
|
|
|
GROUP BY device_type, TO_CHAR(cur_time, 'YYYY-MM-DD HH24:MI:SS'), EXTRACT(YEAR FROM cur_time) |
|
|
|
@ -217,7 +217,7 @@ |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
and cpm.grade = 40 |
|
|
|
and cpm.grade = 40 |
|
|
|
-- and cpm.terminal_device_type = '15' |
|
|
|
and cpm.terminal_device_type = '15' |
|
|
|
) |
|
|
|
) |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
GROUP BY device_type, TO_CHAR(cur_time, 'YYYY-MM-DD HH24:MI:SS'), EXTRACT(YEAR FROM cur_time) |
|
|
|
GROUP BY device_type, TO_CHAR(cur_time, 'YYYY-MM-DD HH24:MI:SS'), EXTRACT(YEAR FROM cur_time) |
|
|
|
@ -260,8 +260,7 @@ |
|
|
|
<if test="systemType != null and systemType != '' "> |
|
|
|
<if test="systemType != null and systemType != '' "> |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
and cpm.grade = 40 |
|
|
|
and cpm.grade = 40 and cpm.terminal_device_type = '15' |
|
|
|
-- and cpm.terminal_device_type = '15' |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
GROUP BY |
|
|
|
GROUP BY |
|
|
|
device_type, |
|
|
|
device_type, |
|
|
|
@ -291,8 +290,7 @@ |
|
|
|
<if test="systemType != null and systemType != '' "> |
|
|
|
<if test="systemType != null and systemType != '' "> |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
and cpm.grade = 40 |
|
|
|
and cpm.grade = 40 and cpm.terminal_device_type = '15' |
|
|
|
-- and cpm.terminal_device_type = '15' |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
GROUP BY |
|
|
|
GROUP BY |
|
|
|
device_type, |
|
|
|
device_type, |
|
|
|
@ -324,7 +322,7 @@ |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
and cpm.grade = 40 |
|
|
|
and cpm.grade = 40 |
|
|
|
-- and cpm.terminal_device_type = '15' |
|
|
|
and cpm.terminal_device_type = '15' |
|
|
|
) |
|
|
|
) |
|
|
|
GROUP BY |
|
|
|
GROUP BY |
|
|
|
device_type, |
|
|
|
device_type, |
|
|
|
@ -355,7 +353,7 @@ |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
and cpm.grade = 40 |
|
|
|
and cpm.grade = 40 |
|
|
|
-- and cpm.terminal_device_type = '15' |
|
|
|
and cpm.terminal_device_type = '15' |
|
|
|
) |
|
|
|
) |
|
|
|
GROUP BY |
|
|
|
GROUP BY |
|
|
|
device_type, |
|
|
|
device_type, |
|
|
|
@ -408,7 +406,7 @@ |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
and cpm.grade = 40 |
|
|
|
and cpm.grade = 40 |
|
|
|
-- and cpm.terminal_device_type = '15' |
|
|
|
and cpm.terminal_device_type = '15' |
|
|
|
) |
|
|
|
) |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
GROUP BY TO_CHAR(cur_time, 'YYYY-MM-DD HH24:MI:SS'), EXTRACT(YEAR FROM cur_time) |
|
|
|
GROUP BY TO_CHAR(cur_time, 'YYYY-MM-DD HH24:MI:SS'), EXTRACT(YEAR FROM cur_time) |
|
|
|
@ -448,7 +446,7 @@ |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
and cpm.grade = 40 |
|
|
|
and cpm.grade = 40 |
|
|
|
-- and cpm.terminal_device_type = '15' |
|
|
|
and cpm.terminal_device_type = '15' |
|
|
|
) |
|
|
|
) |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
GROUP BY EXTRACT(YEAR FROM cur_time) |
|
|
|
GROUP BY EXTRACT(YEAR FROM cur_time) |
|
|
|
@ -511,7 +509,7 @@ |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
and cpm.grade = 40 |
|
|
|
and cpm.grade = 40 |
|
|
|
-- and cpm.terminal_device_type = '15' |
|
|
|
and cpm.terminal_device_type = '15' |
|
|
|
) |
|
|
|
) |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
group by |
|
|
|
group by |
|
|
|
@ -553,7 +551,7 @@ |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
and cpm.grade = 40 |
|
|
|
and cpm.grade = 40 |
|
|
|
-- and cpm.terminal_device_type = '15' |
|
|
|
and cpm.terminal_device_type = '15' |
|
|
|
) |
|
|
|
) |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
group by |
|
|
|
group by |
|
|
|
@ -606,7 +604,7 @@ |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
and cpm.grade = 40 |
|
|
|
and cpm.grade = 40 |
|
|
|
-- and cpm.terminal_device_type = '15' |
|
|
|
and cpm.terminal_device_type = '15' |
|
|
|
) |
|
|
|
) |
|
|
|
group by |
|
|
|
group by |
|
|
|
substring(to_char(cur_time, 'YYYY-MM-DD HH24:MI:SS') from 1 for ${len}), |
|
|
|
substring(to_char(cur_time, 'YYYY-MM-DD HH24:MI:SS') from 1 for ${len}), |
|
|
|
@ -637,7 +635,7 @@ |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
and cpm.grade = 40 |
|
|
|
and cpm.grade = 40 |
|
|
|
-- and cpm.terminal_device_type = '15' |
|
|
|
and cpm.terminal_device_type = '15' |
|
|
|
) |
|
|
|
) |
|
|
|
group by |
|
|
|
group by |
|
|
|
substring(to_char(cur_time, 'YYYY-MM-DD HH24:MI:SS') from 1 for ${len}), |
|
|
|
substring(to_char(cur_time, 'YYYY-MM-DD HH24:MI:SS') from 1 for ${len}), |
|
|
|
@ -669,7 +667,7 @@ |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
and cpm.grade = 40 |
|
|
|
and cpm.grade = 40 |
|
|
|
-- and cpm.terminal_device_type = '15' |
|
|
|
and cpm.terminal_device_type = '15' |
|
|
|
) |
|
|
|
) |
|
|
|
group by |
|
|
|
group by |
|
|
|
extract(year from cur_time) |
|
|
|
extract(year from cur_time) |
|
|
|
@ -698,7 +696,7 @@ |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
and cpm.system_type = #{systemType} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
and cpm.grade = 40 |
|
|
|
and cpm.grade = 40 |
|
|
|
-- and cpm.terminal_device_type = '15' |
|
|
|
and cpm.terminal_device_type = '15' |
|
|
|
) |
|
|
|
) |
|
|
|
group by |
|
|
|
group by |
|
|
|
extract(year from cur_time) |
|
|
|
extract(year from cur_time) |
|
|
|
@ -1031,7 +1029,7 @@ |
|
|
|
order by timeStr |
|
|
|
order by timeStr |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<select id="queryLineDataSysByOne" resultType="com.mh.common.core.domain.entity.ConsumptionAnalyze"> |
|
|
|
<select id="queryLineDataSysByOne" resultType="com.mh.common.core.domain.entity.ConsumptionAnalyze"><![CDATA[ |
|
|
|
select |
|
|
|
select |
|
|
|
sum(coalesce(calc_value,0)) as curValue, |
|
|
|
sum(coalesce(calc_value,0)) as curValue, |
|
|
|
'efrMeter' as deviceType, |
|
|
|
'efrMeter' as deviceType, |
|
|
|
@ -1041,7 +1039,7 @@ |
|
|
|
${curTable} dm |
|
|
|
${curTable} dm |
|
|
|
where |
|
|
|
where |
|
|
|
dm.cur_time >= #{startTime}::timestamp |
|
|
|
dm.cur_time >= #{startTime}::timestamp |
|
|
|
and dm.cur_time <= #{endTime}::timestamp |
|
|
|
and dm.cur_time <= #{endTime}::timestamp |
|
|
|
and dm.device_num in ( |
|
|
|
and dm.device_num in ( |
|
|
|
select |
|
|
|
select |
|
|
|
cpm.mt_num |
|
|
|
cpm.mt_num |
|
|
|
@ -1068,7 +1066,7 @@ |
|
|
|
${curTable} dm |
|
|
|
${curTable} dm |
|
|
|
where |
|
|
|
where |
|
|
|
dm.cur_time >= #{startTime}::timestamp |
|
|
|
dm.cur_time >= #{startTime}::timestamp |
|
|
|
and dm.cur_time <= #{endTime}::timestamp |
|
|
|
and dm.cur_time <= #{endTime}::timestamp |
|
|
|
and dm.device_num in ( |
|
|
|
and dm.device_num in ( |
|
|
|
select |
|
|
|
select |
|
|
|
cpm.mt_num |
|
|
|
cpm.mt_num |
|
|
|
@ -1080,14 +1078,15 @@ |
|
|
|
and dl.device_type = '6' |
|
|
|
and dl.device_type = '6' |
|
|
|
and cpm.grade = 140 |
|
|
|
and cpm.grade = 140 |
|
|
|
and cpm.terminal_device_type = '15' |
|
|
|
and cpm.terminal_device_type = '15' |
|
|
|
|
|
|
|
and cpm.param_type = '17' |
|
|
|
) |
|
|
|
) |
|
|
|
group by |
|
|
|
group by |
|
|
|
device_type, |
|
|
|
device_type, |
|
|
|
TO_CHAR(dm.cur_time, |
|
|
|
TO_CHAR(dm.cur_time, |
|
|
|
'YYYY-MM-DD HH24:MI') |
|
|
|
'YYYY-MM-DD HH24:MI') |
|
|
|
</select> |
|
|
|
]]></select> |
|
|
|
|
|
|
|
|
|
|
|
<select id="queryLineDataSysByMany" resultType="com.mh.common.core.domain.entity.ConsumptionAnalyze"> |
|
|
|
<select id="queryLineDataSysByMany" resultType="com.mh.common.core.domain.entity.ConsumptionAnalyze"><![CDATA[ |
|
|
|
select |
|
|
|
select |
|
|
|
sum(coalesce(calc_value,0)) as curValue, |
|
|
|
sum(coalesce(calc_value,0)) as curValue, |
|
|
|
'efrMeter' as deviceType, |
|
|
|
'efrMeter' as deviceType, |
|
|
|
@ -1097,7 +1096,7 @@ |
|
|
|
${lastTable} dm |
|
|
|
${lastTable} dm |
|
|
|
where |
|
|
|
where |
|
|
|
dm.cur_time >= #{startTime}::timestamp |
|
|
|
dm.cur_time >= #{startTime}::timestamp |
|
|
|
and dm.cur_time <= #{endTime}::timestamp |
|
|
|
and dm.cur_time <= #{endTime}::timestamp |
|
|
|
and dm.device_num in ( |
|
|
|
and dm.device_num in ( |
|
|
|
select |
|
|
|
select |
|
|
|
cpm.mt_num |
|
|
|
cpm.mt_num |
|
|
|
@ -1123,7 +1122,7 @@ |
|
|
|
${lastTable} dm |
|
|
|
${lastTable} dm |
|
|
|
where |
|
|
|
where |
|
|
|
dm.cur_time >= #{startTime}::timestamp |
|
|
|
dm.cur_time >= #{startTime}::timestamp |
|
|
|
and dm.cur_time <= #{endTime}::timestamp |
|
|
|
and dm.cur_time <= #{endTime}::timestamp |
|
|
|
and dm.device_num in ( |
|
|
|
and dm.device_num in ( |
|
|
|
select |
|
|
|
select |
|
|
|
cpm.mt_num |
|
|
|
cpm.mt_num |
|
|
|
@ -1134,6 +1133,7 @@ |
|
|
|
cpm.device_ledger_id = dl.id |
|
|
|
cpm.device_ledger_id = dl.id |
|
|
|
and dl.device_type = '6' |
|
|
|
and dl.device_type = '6' |
|
|
|
and cpm.grade = 140 and cpm.terminal_device_type = '15' |
|
|
|
and cpm.grade = 140 and cpm.terminal_device_type = '15' |
|
|
|
|
|
|
|
and cpm.param_type = '17' |
|
|
|
) |
|
|
|
) |
|
|
|
group by |
|
|
|
group by |
|
|
|
device_type, |
|
|
|
device_type, |
|
|
|
@ -1149,7 +1149,7 @@ |
|
|
|
${curTable} dm |
|
|
|
${curTable} dm |
|
|
|
where |
|
|
|
where |
|
|
|
dm.cur_time >= #{startTime}::timestamp |
|
|
|
dm.cur_time >= #{startTime}::timestamp |
|
|
|
and dm.cur_time <= #{endTime}::timestamp |
|
|
|
and dm.cur_time <= #{endTime}::timestamp |
|
|
|
and dm.device_num in ( |
|
|
|
and dm.device_num in ( |
|
|
|
select |
|
|
|
select |
|
|
|
cpm.mt_num |
|
|
|
cpm.mt_num |
|
|
|
@ -1175,7 +1175,7 @@ |
|
|
|
${curTable} dm |
|
|
|
${curTable} dm |
|
|
|
where |
|
|
|
where |
|
|
|
dm.cur_time >= #{startTime}::timestamp |
|
|
|
dm.cur_time >= #{startTime}::timestamp |
|
|
|
and dm.cur_time <= #{endTime}::timestamp |
|
|
|
and dm.cur_time <= #{endTime}::timestamp |
|
|
|
and dm.device_num in ( |
|
|
|
and dm.device_num in ( |
|
|
|
select |
|
|
|
select |
|
|
|
cpm.mt_num |
|
|
|
cpm.mt_num |
|
|
|
@ -1185,13 +1185,13 @@ |
|
|
|
on |
|
|
|
on |
|
|
|
cpm.device_ledger_id = dl.id |
|
|
|
cpm.device_ledger_id = dl.id |
|
|
|
and dl.device_type = '6' |
|
|
|
and dl.device_type = '6' |
|
|
|
and cpm.grade = 140 and cpm.terminal_device_type = '15' |
|
|
|
and cpm.grade = 140 and cpm.terminal_device_type = '15' and cpm.param_type = '17' |
|
|
|
) |
|
|
|
) |
|
|
|
group by |
|
|
|
group by |
|
|
|
device_type, |
|
|
|
device_type, |
|
|
|
TO_CHAR(dm.cur_time, |
|
|
|
TO_CHAR(dm.cur_time, |
|
|
|
'YYYY-MM-DD HH24:MI') |
|
|
|
'YYYY-MM-DD HH24:MI') |
|
|
|
</select> |
|
|
|
]]></select> |
|
|
|
|
|
|
|
|
|
|
|
<select id="queryDeviceLineManyTable" resultType="com.mh.common.core.domain.entity.ConsumptionAnalyze"> |
|
|
|
<select id="queryDeviceLineManyTable" resultType="com.mh.common.core.domain.entity.ConsumptionAnalyze"> |
|
|
|
<if test="lastTableName != curTableName"> |
|
|
|
<if test="lastTableName != curTableName"> |
|
|
|
|