zbj//大屏暂降事件时间统计

This commit is contained in:
zhangbaojian
2023-04-03 11:47:46 +08:00
parent 3b68f67ac3
commit 62d0e20cba
6 changed files with 129 additions and 1 deletions

View File

@@ -16,4 +16,6 @@ public interface LargeScreenMapper {
List<Map<String, Object>> selectLoadTypeCount(@Param("lineIds") List<String> lineIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
List<Map<String, Object>> getTimeCount(@Param("lineIds") List<String> lineIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
}

View File

@@ -37,4 +37,20 @@
</if>
group by ed.measurement_point_id
</select>
<select id="getTimeCount" resultType="java.util.Map">
select
date(ed.create_time) "day", count(*) "count"
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 day
</select>
</mapper>