1.监测点异常统计报表调整

This commit is contained in:
wr
2026-01-28 11:26:52 +08:00
parent 2a5a5087ad
commit 3f77d30cfd
4 changed files with 259 additions and 16 deletions

View File

@@ -148,7 +148,7 @@
<select id="getMonthFlow" resultType="com.njcn.device.pq.pojo.vo.LineFlowMealDetailVO">
select t.*,
(t.statisValue)/t.flowMeal flowProportion
(t.statisValue / t.flowMeal) as flowProportion
from (
SELECT
a.id id,
@@ -158,8 +158,6 @@
gd.name electricPowerCompany,
b.IP DeviceIP,
b.id deviceId,
-- ifnull(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + ifnull(d1.flow, 0) flowMeal,
-- ifnull(convert(m.Actual_Value/1024/1024,decimal(7,2)),0) statisValue
COALESCE(d.flow, (SELECT flow FROM cld_flow_meal WHERE type = 0 AND flag = 1)) + COALESCE(d1.flow, 0) AS flowMeal,
COALESCE(CAST(m.Actual_Value / 1024 / 1024 AS DECIMAL(7, 2)), 0) AS statisValue
FROM pq_line a
@@ -170,16 +168,20 @@
LEFT JOIN cld_dev_meal c ON b.id = c.line_id
LEFT JOIN cld_flow_meal d ON c.Base_Meal_Id = d.id
LEFT JOIN cld_flow_meal d1 ON c.Ream_Meal_Id = d1.id
WHERE a.id IN
<where>
a.id IN
<foreach item="item" collection="devs" separator="," open="(" close=")">
#{item}
</foreach>
AND
m.Time_Id between #{startTime} and #{endTime}
AND
<if test="startTime != null and endTime != null">
AND
m.Time_Id between #{startTime} and #{endTime}
</if>
AND
b.Run_Flag != 2
</where>
) t
ORDER BY flowProportion DESC
ORDER BY flowProportion DESC ;
</select>
<select id="getMonthFlowNew" resultType="com.njcn.device.pq.pojo.vo.LineFlowMealDetailVO">