drop procedure dp_gridkeeper_online_proc;
-- 网格员时间段统计存储过程
CREATE PROCEDURE `dp_gridkeeper_online_proc`()
begin
-- 开启事务
start transaction;
-- 插入数据
insert into t_gridkeeper_online ( orgid, orgname ,yonline , zxonline , createdate )
select * from t_gridkeeper_online _copy;
-- 提交事务
commit ;
end
--调用
call dp_gridkeeper_online_proc();
-- 删除事件
DROP event dp_gridkeeper_online_proc_event;
-- 每天 10:18:23 执行
CREATE EVENT IF NOT EXISTS dp_gridkeeper_online_proc_event
ON SCHEDULE EVERY 1 DAY STARTS '2019-07-23 10:18:23' ON COMPLETION NOT PRESERVE ENABLE
DO call dp_gridkeeper_online_proc();
-- 查询所有事件
SELECT * FROM information_schema.events;