zbj//大屏获取暂降事件最新50条数据

This commit is contained in:
zhangbaojian
2023-04-03 14:58:20 +08:00
parent 965f7af233
commit 91bdf291ab
6 changed files with 116 additions and 6 deletions

View File

@@ -18,4 +18,5 @@ 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);
}

View File

@@ -53,4 +53,24 @@
</if>
group by day
</select>
<select id="eventLists" resultType="java.util.Map">
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>
<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>
</where>
order by time desc
limit 50
</select>
</mapper>