-- lawe.v_bi_alm_all_alarm_hour source CREATE OR REPLACE ALGORITHM = UNDEFINED VIEW `v_bi_alm_all_alarm_hour` AS select `m`.`alarm_object_ip` AS `alarm_object_ip`, `m`.`alarm_object_id` AS `alarm_object_id`, `m`.`alarm_object_type` AS `alarm_object_type`, `m`.`alarm_object_name` AS `alarm_object_name`, `m`.`severity_id` AS `severity_id`, `m`.`title` AS `title`, `m`.`alarm_text` AS `alarm_text`, `m`.`clr_status` AS `clr_status`, `m`.`alarm_count` AS `alarm_count`, `m`.`bg_time` AS `bg_time`, `m`.`ed_time` AS `ed_time`, `m`.`hours` AS `hours`, `m`.`dtype` AS `dtype`, `m`.`thedvalue` AS `thedvalue`, `m`.`is_active_alarm` AS `is_active_alarm`, floor((`m`.`alarm_count` / `m`.`hours`)) AS `avg_alarm_count`, if((`m`.`alarm_source` = '性能告警'), (60 / 5), (60 * 2)) AS `collection_frequency`, CASE WHEN occur_time<=thedvalue_b and update_time>=thedvalue_e THEN 60 WHEN occur_time>thedvalue_b and update_time>=thedvalue_e THEN 60-MOD(occur_time,100) WHEN occur_time<=thedvalue_b and update_timethedvalue_b and update_time