zbj//大屏暂降事件负荷类型

This commit is contained in:
zhangbaojian
2023-04-03 10:48:35 +08:00
parent 4dcad30d5d
commit 3b68f67ac3
6 changed files with 146 additions and 10 deletions

View File

@@ -13,4 +13,7 @@ import java.util.Map;
public interface LargeScreenMapper {
Map<String, Object> selectDownCount(@Param("lineIds") List<String> lineIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
List<Map<String, Object>> selectLoadTypeCount(@Param("lineIds") List<String> lineIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
}

View File

@@ -6,17 +6,35 @@
select
count(ed.event_id) "count"
from r_mp_event_detail ed
left join sys_dict_data dd on ed.event_type and dd.Type_Id ='c37861896dafab0883321e1d508caa51'
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(pl.Create_Time,'%y%m%d') &gt;= date_format(#{startTime},'%y%m%d')
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(pl.Create_Time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
and date_format(ed.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
</select>
<select id="selectLoadTypeCount" resultType="java.util.Map">
select count(ed.event_id) "count",
ed.measurement_point_id "id"
from r_mp_event_detail ed
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>
group by ed.measurement_point_id
</select>
</mapper>