zbj//1.大屏中间所有数据未写完 2.大屏中间暂态

This commit is contained in:
zhangbaojian
2023-04-06 10:03:25 +08:00
parent c0a3b75295
commit e45a3d6dab
6 changed files with 239 additions and 8 deletions

View File

@@ -1,5 +1,7 @@
package com.njcn.event.mapper.majornetwork;
import com.njcn.device.pq.pojo.vo.AllDataVO;
import com.njcn.device.pq.pojo.vo.EventVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -19,4 +21,10 @@ public interface LargeScreenMapper {
List<Map<String, Object>> getTimeCount(@Param("lineIds") List<String> lineIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
List<Map<String, Object>> eventLists(@Param("startTime") String startTime, @Param("endTime") String endTime);
AllDataVO getFlagCount(@Param("lineIds") List<String> lineIds);
Map<String, Object> getDownCount (@Param("lineIds") List<String> lineIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
List<EventVO> getMiddleDown (@Param("lineIds") List<String> lineIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
}

View File

@@ -73,4 +73,59 @@
limit 50
</select>
<select id="getFlagCount" resultType="com.njcn.device.pq.pojo.vo.AllDataVO">
select
count(case when pd.Run_Flag = 0 then 1 end) running,
count(case when pd.Run_Flag = 1 then 1 end) hotSpare,
count(case when pd.Run_Flag = 2 then 1 end) shutdown,
count(case when pd.Com_Flag = 0 then 1 end) breakdown,
count(case when pd.Com_Flag = 1 then 1 end) normal
from pq_device pd
where pd.id in
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</select>
<select id="getDownCount" resultType="java.util.Map">
select
count(ed.event_id) "count"
from r_mp_event_detail ed
left join sys_dict_data sdd on ed.event_type = sdd.id and sdd.code = 'Voltage_Dip'
where
ed.measurement_point_id in
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
<if test="startTime != null and startTime != ''">
and date_format(ed.create_time,'%y%m%d') &gt;= date_format(#{startTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''">
and date_format(ed.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
</select>
<select id="getMiddleDown" resultType="com.njcn.device.pq.pojo.vo.EventVO">
SELECT
ed.create_time "time",pl.`Name` "name",sdd.`Name` reason,sdd.`Name` "type",ed.feature_amplitude amplitude,ed.duration
from r_mp_event_detail ed
left join pq_line pl on pl.id = ed.measurement_point_id
left join sys_dict_data sdd on sdd.id = ed.advance_reason
left join sys_dict_data sdd2 on sdd.id = ed.advance_type
where
ed.measurement_point_id in
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
<if test="startTime != null and startTime != ''">
and date_format(ed.create_time,'%y%m%d') &gt;= date_format(#{startTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''">
and date_format(ed.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
order by ed.create_time desc
</select>
</mapper>