更新了初始化文件

添加初始化数据库结构文件
This commit is contained in:
xiaochou164 2023-08-10 10:03:53 +08:00
parent 60a75e01e7
commit 509aa0a9f9
3 changed files with 10 additions and 373 deletions

View File

@ -1,2 +1,8 @@
# YZ_MES # YZ_MES
@authorgongchengbo
@createdate:2023-08-09
@updatedate:2023-08-10
这是用于宇泽MES数据库拉取到办公电脑做数据分析使用

View File

@ -0,0 +1,3 @@
create schema reportdata collate utf8mb4_general_ci;
create schema mes_sync collate utf8mb4_general_ci;
create schema mes_origin collate utf8mb4_general_ci;

View File

@ -2187,376 +2187,4 @@ CREATE TABLE `yz_mes_spec_value` (
`value` varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '属性公差/下值', `value` varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '属性公差/下值',
`is_contain` varchar(4) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '是否包含上下值 0全部包含 1包含上值 2 包含下值', `is_contain` varchar(4) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '是否包含上下值 0全部包含 1包含上值 2 包含下值',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- SyncMesData_every_12_hours(): routine
CREATE DEFINER=`root`@`%` PROCEDURE `SyncMesData_every_12_hours`()
BEGIN
#REPLACE into mes_sync.mes_job SELECT * from mes_origin.mes_job;
#REPLACE into mes_sync.erp_job_mtl_manage_task SELECT * from mes_origin.erp_job_mtl_manage_task;
#REPLACE into mes_sync.erp_job_mtl_manage_detail SELECT * from mes_origin.erp_job_mtl_manage_detail;
#REPLACE into mes_sync.erp_job_mtl SELECT * from mes_origin.erp_job_mtl;
#REPLACE into mes_sync.mes_job_recipe SELECT * from mes_origin.mes_job_recipe;
#REPLACE into mes_sync.mes_material SELECT * from mes_origin.mes_material;
#REPLACE into mes_sync.erp_job_opr SELECT * from mes_origin.erp_job_opr;
#REPLACE into mes_sync.mes_mother_alloy_task SELECT * from mes_origin.mes_mother_alloy_task;
#REPLACE into mes_sync.mes_mother_alloy SELECT * from mes_origin.mes_mother_alloy;
#REPLACE into mes_sync.mes_vehicle_feed_task SELECT * from mes_origin.mes_vehicle_feed_task;
#REPLACE into mes_sync.mes_task_send_erp SELECT * from mes_origin.mes_task_send_erp;
#REPLACE into mes_sync.mes_sub_chamber_task SELECT * from mes_origin.mes_sub_chamber_task;
#REPLACE into mes_sync.mes_seedcrystal_change SELECT * from mes_origin.mes_seedcrystal_change;
#REPLACE into mes_sync.mes_surplus_collect_task SELECT * from mes_origin.mes_surplus_collect_task;
#REPLACE into mes_sync.mes_surplus SELECT * from mes_origin.mes_surplus;
#REPLACE into mes_sync.mes_surplus_confirm_task SELECT * from mes_origin.mes_surplus_confirm_task;
#REPLACE into mes_sync.mes_vehicle_crystal SELECT * from mes_origin.mes_vehicle_crystal;
#REPLACE into mes_sync.mes_dismantle_task SELECT * from mes_origin.mes_dismantle_task;
#REPLACE into mes_sync.mes_dismantle_thermal SELECT * from mes_origin.mes_dismantle_thermal;
#REPLACE into mes_sync.mes_draw_line_task SELECT * from mes_origin.mes_draw_line_task;
#REPLACE into mes_sync.mes_round_bar_label SELECT * from mes_origin.mes_round_bar_label;
#REPLACE into mes_sync.mes_truncation_task SELECT * from mes_origin.mes_truncation_task;
#REPLACE into mes_sync.mes_resistance_gauging_task SELECT * from mes_origin.mes_resistance_gauging_task;
#REPLACE into mes_sync.mes_oxygen_carbon_detection_task SELECT * from mes_origin.mes_oxygen_carbon_detection_task;
#REPLACE into mes_sync.mes_specimen SELECT * from mes_origin.mes_specimen;
#REPLACE into mes_sync.mes_electrical_performance_task SELECT * from mes_origin.mes_electrical_performance_task;
#REPLACE into mes_sync.mes_square_task SELECT * from mes_origin.mes_square_task;
#REPLACE into mes_sync.mes_roll_rub_task SELECT * from mes_origin.mes_roll_rub_task;
#REPLACE into mes_sync.mes_multi_cut SELECT * from mes_origin.mes_multi_cut;
#REPLACE into mes_sync.mes_seed_crystal_machine_task SELECT * from mes_origin.mes_seed_crystal_machine_task;
#REPLACE into mes_sync.mes_seed_crystal SELECT * from mes_origin.mes_seed_crystal;
REPLACE into mes_sync.mes_recycle_material_storage SELECT * from mes_origin.mes_recycle_material_storage;
#REPLACE into mes_sync.mes_split_storage SELECT * from mes_origin.mes_split_storage;
#REPLACE into mes_sync.mes_pre_clean SELECT * from mes_origin.mes_pre_clean;
#REPLACE into mes_sync.mes_washable_silicon_qc_task SELECT * from mes_origin.mes_washable_silicon_qc_task;
#REPLACE into mes_sync.mes_recycle_material_storage_detail SELECT * from mes_origin.mes_recycle_material_storage_detail;
#REPLACE into mes_sync.mes_silicon_clean_task SELECT * from mes_origin.mes_silicon_clean_task;
#REPLACE into mes_sync.mes_silicon_clean_soak SELECT * from mes_origin.mes_silicon_clean_soak;
#REPLACE into mes_sync.mes_silicon_clean_soak_manage SELECT * from mes_origin.mes_silicon_clean_soak_manage;
#REPLACE into mes_sync.mes_silicon_clean_auto SELECT * from mes_origin.mes_silicon_clean_auto;
#REPLACE into mes_sync.mes_silicon_clean_fracture SELECT * from mes_origin.mes_silicon_clean_fracture;
#REPLACE into mes_sync.mes_magnet_choice SELECT * from mes_origin.mes_magnet_choice;
#REPLACE into mes_sync.mes_disposable_qc_task SELECT * from mes_origin.mes_disposable_qc_task;
#REPLACE into mes_sync.mes_crystal_flow SELECT * from mes_origin.mes_crystal_flow;
#REPLACE into mes_sync.mes_order_tracing SELECT * from mes_origin.mes_order_tracing;
#REPLACE into mes_sync.mes_device SELECT * from mes_origin.mes_device;
#REPLACE into mes_sync.mes_device_attribute SELECT * from mes_origin.mes_device_attribute;
#REPLACE into mes_sync.mes_turnover_container SELECT * from mes_origin.mes_turnover_container;
#REPLACE into mes_sync.mes_abnormal_feedback SELECT * from mes_origin.mes_abnormal_feedback;
#REPLACE into mes_sync.sys_package_version_manage SELECT * from mes_origin.sys_package_version_manage;
#REPLACE into mes_sync.mes_packing_detail SELECT * from mes_origin.mes_packing_detail;
#REPLACE into mes_sync.raipiot_log_error SELECT * from mes_origin.raipiot_log_error;
#REPLACE into mes_sync.mes_electrical_performance_task_log SELECT * from mes_origin.mes_electrical_performance_task_log;
#REPLACE into mes_sync.mes_work_order SELECT * from mes_origin.mes_work_order;
REPLACE into mes_sync.yz_mes_spec SELECT * from mes_origin.yz_mes_spec;
REPLACE into mes_sync.yz_mes_spec_value SELECT * from mes_origin.yz_mes_spec_value;
#REPLACE into mes_sync.raipiot_log_api SELECT * from mes_origin.raipiot_log_api;
#REPLACE into mes_sync.mes_work_order_job_detail SELECT * from mes_origin.mes_work_order_job_detail;
#REPLACE into mes_sync.mes_mother_alloy_bind SELECT * from mes_origin.mes_mother_alloy_bind;
#REPLACE into mes_sync.mes_schedule SELECT * from mes_origin.mes_schedule;
#REPLACE into mes_sync.mes_thermal_field_material SELECT * from mes_origin.mes_thermal_field_material;
#REPLACE into mes_sync.mes_work_order_job_half SELECT * from mes_origin.mes_work_order_job_half;
#REPLACE into mes_sync.mes_work_order_job SELECT * from mes_origin.mes_work_order_job;
#REPLACE into mes_sync.raipiot_log_usual SELECT * from mes_origin.raipiot_log_usual;
#REPLACE into mes_sync.sys_dict_type SELECT * from mes_origin.sys_dict_type;
#REPLACE into mes_sync.mes_dict SELECT * from mes_origin.mes_dict;
#REPLACE into mes_sync.sys_dict_data SELECT * from mes_origin.sys_dict_data;
END;
-- SyncMesData_every_2_hours(): routine
CREATE DEFINER=`root`@`%` PROCEDURE `SyncMesData_every_2_hours`()
BEGIN
REPLACE into mes_sync.mes_report_task SELECT * from mes_origin.mes_report_task;
REPLACE into mes_sync.mes_crystal_order SELECT * from mes_origin.mes_crystal_order;
REPLACE into mes_sync.mes_poi_formula SELECT * from mes_origin.mes_poi_formula;
REPLACE into mes_sync.mes_feeding_task SELECT * from mes_origin.mes_feeding_task;
REPLACE into mes_sync.mes_feeding_detail SELECT * from mes_origin.mes_feeding_detail;
REPLACE into mes_sync.mes_transport_task SELECT * from mes_origin.mes_transport_task;
REPLACE into mes_sync.mes_furnace_task SELECT * from mes_origin.mes_furnace_task;
REPLACE into mes_sync.mes_furnace_detail SELECT * from mes_origin.mes_furnace_detail;
REPLACE into mes_sync.mes_stick_task SELECT * from mes_origin.mes_stick_task;
REPLACE into mes_sync.mes_production SELECT * from mes_origin.mes_production;
REPLACE into mes_sync.mes_round_bar SELECT * from mes_origin.mes_round_bar;
REPLACE into mes_sync.mes_round_bar_status SELECT * from mes_origin.mes_round_bar_status;
REPLACE into mes_sync.mes_roll_rub_quality_task SELECT * from mes_origin.mes_roll_rub_quality_task;
REPLACE into mes_sync.mes_square SELECT * from mes_origin.mes_square;
REPLACE into mes_sync.mes_lifting_box_task SELECT * from mes_origin.mes_lifting_box_task;
REPLACE into mes_sync.mes_packing_task SELECT * from mes_origin.mes_packing_task;
REPLACE into mes_sync.erp_job_mtl_confirm SELECT * from mes_origin.erp_job_mtl_confirm;
REPLACE into mes_sync.erp_job_mtl_send SELECT * from mes_origin.erp_job_mtl_send;
REPLACE into mes_sync.mes_draw_line_task SELECT * from mes_origin.mes_draw_line_task;
REPLACE into mes_sync.mes_disposable_qc_task SELECT * from mes_origin.mes_disposable_qc_task;
END;
-- UpdateAllfeedingdetail(): routine
CREATE DEFINER=`root`@`%` PROCEDURE `UpdateAllfeedingdetail`()
BEGIN
DELETE from reportdata.allfeedingdetail;
replace into reportdata.allfeedingdetail(`month`,mfgdate,mesmoname,eqpid,moprodname,moproddesc,
subprod,rx,stovetype,stovetypedesc,stovetime,prodname,proddesc,material_type,factory,serial_no,weight,
cate1,cate2,cate3,material_level,type,area,area1,eqpmodel,feeding_task_code)
SELECT
CONCAT('M',DATE_FORMAT(DATE_add(ft.update_time,interval -510 MINUTE),'%m')) `month`,
DATE_FORMAT(DATE_add(ft.update_time,interval -510 MINUTE),'%Y-%m-%d') mfgdate,
ft.order_no mesmoname,
ft.stove_no eqpid,
ft.product_no moprodname,
ft.product_name moproddesc,
case when LOCATE('自产',ft.product_name) >0 then mid(ft.product_name,LOCATE('自产',ft.product_name)+3,6)
when LOCATE('代工',ft.product_name) >0 then mid(ft.product_name,LOCATE('代工',ft.product_name)+3,6) end subprod,
ft.feeding_times rx,
ft.type stovetype,
case when ft.type = '1' then '初装'
when ft.type = '2' then '二加' end stovetypedesc,
ft.update_time stovetime,
fd.material_no prodname,
fd.material_name proddesc,
fd.material_type,
fd.factory,
fd.batch_no serial_no,
fd.weight,
p.cate1,
p.cate2,
p.cate3,
p.`level`,
p.type,
eq.area,
eq.area1,
eq.eqpmodel,
ft.feeding_task_code
from mes_sync.mes_furnace_task ft
right join mes_sync.mes_feeding_detail fd on(ft.feeding_task_id = fd.feeding_task_id and fd.material_type = '2')
left join reportdata.product p on (fd.material_no = p.prodname)
left join reportdata.Equipment eq on (ft.stove_no = eq.eqpid)
where ft.`status` = '3';
END;
-- UpdateMostatus(): routine
CREATE DEFINER=`root`@`%` PROCEDURE `UpdateMostatus`()
BEGIN
REPLACE into reportdata.Mostatus(area1,MESmoname,ERPmoname,eqpid,prodname,proddesc,crusize,stovetime,feeding_task_id,crucible,subprod,mostatus,mostatusdesc,finish_time,runtime)
select left(ft.stove_no,1) area1,ft.order_no MESmoname,co.job_code ERPmoname,ft.stove_no eqpid,ft.product_no prodname,ft.product_name proddesc, co.thermal_field crusize,ft.update_time stovetime,ft.feeding_task_id,fd.factory crucible,
case when LOCATE('自产',product_name) >0 then mid(product_name,LOCATE('自产',product_name)+3,6)
when LOCATE('代工',product_name) >0 then mid(product_name,LOCATE('代工',product_name)+3,6) end subprod,
co.finish_flag mostatus,
case when co.finish_flag = '1' then '完结'
when co.finish_flag = '0' then '非完结' end mostatusdesc,
case when co.finish_flag = '1' then f.max_time end finish_time,
case when co.finish_flag = '1' then datediff(f.max_time,ft.update_time) end rutime
from mes_sync.mes_furnace_task ft
LEFT JOIN mes_sync.mes_crystal_order co on(ft.order_no = co.order_no)
LEFT JOIN mes_sync.mes_feeding_detail fd on(ft.feeding_task_id = fd.feeding_task_id and fd.material_type = '1')
left join
(
SELECT DISTINCT order_no,min(finish_rod) finish_rod FROM mes_sync.`mes_stick_task` GROUP BY order_no
) st on (ft.order_no = st.order_no)
left join
(
SELECT DISTINCT order_no,max(create_time) max_time from mes_sync.mes_production GROUP BY order_no
) f on(f.order_no = ft.order_no)
where 1=1
and ft.`status` = '3' # 已正常投炉
and ft.type = '1' #初装
and fd.material_type = '1' #material_type为'1'的是坩埚
order by ft.create_time desc;
##该炉台有新工单的,即使上一棒未完结的,也更新成完结
update reportdata.mostatus mo,(SELECT eqpid,max(stovetime) newtime from reportdata.mostatus group by eqpid) st
set mo.mostatusdesc = '完结' ,mo.mostatus = '1'
where 1=1
and mo.eqpid = st.eqpid
and mo.stovetime < st.newtime;
##异常完结的更新完结时间及运行时间
update reportdata.mostatus mo,(SELECT DISTINCT order_no,max(create_time) max_time,max(substring(code,11,1)) rx from mes_sync.mes_production GROUP BY order_no) f
set mo.finish_time = f.max_time,mo.runtime = datediff(f.max_time,mo.stovetime)
where 1=1
and mo.MESmoname = f.order_no
and mo.finish_time is null
and mo.mostatus = '1' ;
update reportdata.mostatus mo
inner join
(
select DISTINCT mesmoname,rx from reportdata.allfeedingdetail
)af on(mo.mesmoname = af.mesmoname)
set mo.rx=af.rx ;
##将归档的数据上传到云
REPLACE into reportdata.mostatus_cloud SELECT * from reportdata.mostatus;
END;
-- UpdateRecyclematerialouput(): routine
CREATE DEFINER=`root`@`%` PROCEDURE `UpdateRecyclematerialouput`()
BEGIN
replace into reportdata.recyclematerialouput(lotsn,prodname,proddesc,prodtype,level,
resistivity,weight,cate1,type,cate2,cate3,update_time,mfgdate,month)
SELECT order_no lotsn,
material_code prodname,
material_name proddesc,
replace(replace(product_type,'',''),'','') prodtype,
material_type level,
resistivity,
weight,
pd.cate1,
pd.type,
pd.cate2,
pd.cate3,
update_time,
DATE_FORMAT(DATE_add(ms.update_time,interval -510 MINUTE),'%Y-%m-%d') mfgdate,
CONCAT('M',DATE_FORMAT(DATE_add(ms.update_time,interval -510 MINUTE),'%m')) `month`
FROM mes_sync.mes_recycle_material_storage ms
left join reportdata.product pd on (ms.material_code = pd.prodname)
and substring(material_code,6,1) = '1'
where `status` = '2';
END;
-- UpdateSiteOnlineYield(): routine
CREATE DEFINER=`root`@`%` PROCEDURE `UpdateSiteOnlineYield`()
COMMENT '更新产量表存储过称'
BEGIN
replace into reportdata.siteonlinecrucibleyield(crystalbarno,MESmoname,eqpid,actualprodname,actualproddesc,outweight,outlength,outtime)
SELECT code,order_no,stove_no,product_no,product_name,weight,length,update_time
from mes_sync.mes_production mp
order by update_time;
##更新炉台信息
UPDATE reportdata.siteonlinecrucibleyield sy
inner join reportdata.equipment eq on sy.eqpid = eq.eqpid
set sy.area = eq.area,sy.area1= eq.area1,sy.eqpmodel=eq.eqpmodel
where sy.eqpmodel is null;
##更新坩埚信息
UPDATE reportdata.siteonlinecrucibleyield sy
INNER JOIN mes_sync.mes_crystal_order co
on sy.mesmoname = co.order_no
set sy.erpmoname = co.job_code,sy.moprodname = co.material_code,sy.moproddesc = co.material_name,sy.crusize = co.thermal_field
where sy.crusize is null;
##更新工单相关信息
UPDATE reportdata.siteonlinecrucibleyield sy
INNER JOIN reportdata.mostatus mo on (sy.mesmoname = mo.MESmoname)
set sy.crucible = mo.crucible,sy.crunum = mo.cruciblesn,sy.crudesc = mo.crucproddesc,sy.subprod = mo.subprod,sy.stovetime=mo.stovetime
where sy.crucible is null;
###更新折重系数
UPDATE reportdata.siteonlinecrucibleyield sy
INNER JOIN mes_sync.yz_mes_spec yms on(sy.subprod = yms.spec_code)
set sy.hair_rod_coefficient = yms.hair_rod_coefficient,sy.round_rod_coefficient = yms.round_rod_coefficient
where sy.hair_rod_coefficient is null or sy.round_rod_coefficient is null or sy.hair_square_rod_coefficient is null;
###更新折重系数——MES中未维护的使用自己维护的补充
UPDATE reportdata.siteonlinecrucibleyield sy
INNER JOIN reportdata.prod p on(sy.subprod = p.code)
set sy.hair_rod_coefficient = p.round,sy.hair_square_rod_coefficient = p.square
where sy.hair_rod_coefficient is null or sy.round_rod_coefficient is null or sy.hair_square_rod_coefficient is null;
###更新有效长度
UPDATE reportdata.siteonlinecrucibleyield sy
INNER JOIN (
SELECT
production_code,sum(draw_length) qclength
FROM mes_sync.mes_round_bar
where right(code,1) = '0'
group by production_code
)ps on (sy.crystalbarno = ps.production_code)
set sy.qclength = ps.qclength
where sy.qclength is null;
##更新QC时间及计产日期
UPDATE reportdata.siteonlinecrucibleyield sy
INNER JOIN mes_sync.mes_draw_line_task dlt on (sy.crystalbarno = dlt.hairy_rod_crystal_code and dlt.`status` = '3')
set sy.qctime = dlt.update_time,
sy.mfgdate = DATE_FORMAT(DATE_add(dlt.update_time,interval -510 MINUTE),'%Y-%m-%d')
where sy.qctime is null;
##更新QC重量
UPDATE reportdata.siteonlinecrucibleyield set qcweight = qclength/hair_rod_coefficient where qcweight is null;
UPDATE reportdata.siteonlinecrucibleyield set squareqcweight = qclength/hair_square_rod_coefficient where squareqcweight is null;
######建临时表处理两棒工序时间########################################
DROP TEMPORARY TABLE IF EXISTS crystalbarno;
CREATE TEMPORARY TABLE crystalbarno (
id int,
idd varchar(100),
eqpid VARCHAR(100),
crystalbarno varchar(200),
outtime datetime,
lastcrystalbarno VARCHAR(200),
lastouttime datetime
);
insert into crystalbarno(id,idd,eqpid,crystalbarno,outtime)
SELECT
ROW_NUMBER() over(partition by stove_no order by UPDATE_time desc) id,
CONCAT(stove_no,'-',ROW_NUMBER() over(partition by stove_no order by UPDATE_time desc)) idd,
stove_no,code, UPDATE_time
from mes_sync.mes_production;
UPDATE crystalbarno cy
INNER JOIN
(
SELECT
ROW_NUMBER() over(partition by stove_no order by UPDATE_time desc) -1 id,
CONCAT(stove_no,'-',ROW_NUMBER() over(partition by stove_no order by UPDATE_time desc)-1) idd,
stove_no,code, UPDATE_time
from mes_sync.mes_production
) mp on (cy.idd = mp.idd)
set cy.lastouttime = mp.UPDATE_time,cy.lastcrystalbarno = mp.code;
UPDATE reportdata.siteonlinecrucibleyield sy
INNER JOIN crystalbarno cr on (sy.crystalbarno = cr.crystalbarno)
set sy.lastcrystalbarno = cr.lastcrystalbarno,sy.lastouttime = cr.lastouttime
where sy.lastcrystalbarno is null;
DROP TEMPORARY TABLE crystalbarno;
######删除临时表########################################
###更新运行时间
UPDATE reportdata.siteonlinecrucibleyield sy
set timeinterval = timestampdiff(second,lastouttime,outtime) / (24 * 60 * 60)
where timeinterval is null;
###更新首棒停炉时间过长的运行时间
UPDATE reportdata.siteonlinecrucibleyield sy
set timeinterval = timestampdiff(second,stovetime,outtime) / (24 * 60 * 60) + 8/24
where 1=1
and datediff(stovetime,lastouttime) >= 18/24
and crystalbarno like '%11N';
##处理坩埚厂商乱码
UPDATE reportdata.siteonlinecrucibleyield sy
INNER JOIN reportdata.adjustcruc ac on (sy.mesmoname = ac.mesmoname)
set sy.adjustcrucible = ac.crucible
where sy.adjustcrucible is null;
##根据坩埚
UPDATE reportdata.siteonlinecrucibleyield sy
INNER JOIN reportdata.dict d on (sy.adjustcrucible = d.dictkey and d.cate = 'cruccode')
set sy.adjustcruciblecode = d.value;
UPDATE reportdata.siteonlinecrucibleyield sy
INNER JOIN reportdata.dict d on (sy.crucible = d.dictkey and d.cate = 'crucname')
set sy.adjustcruciblecode = d.value,sy.adjustcrucible = d.value1;
END;
-- SyncMesData_every_12_hours: scheduled event
CREATE DEFINER=`root`@`%` EVENT `SyncMesData_every_12_hours` ON SCHEDULE EVERY 2 HOUR STARTS '2023-07-07 19:00:49' ON COMPLETION NOT PRESERVE ENABLE COMMENT '每12小时更新重要的表' DO call SyncMesData_every_12_hours();
-- SyncMesData_every_2_hours: scheduled event
CREATE DEFINER=`root`@`%` EVENT `SyncMesData_every_2_hours` ON SCHEDULE EVERY 2 HOUR STARTS '2023-07-07 16:31:49' ON COMPLETION NOT PRESERVE ENABLE COMMENT '每两小时更新重要的表' DO call SyncMesData_every_2_hours();
-- UpdateAllfeedingdetail_4_hours: scheduled event
CREATE DEFINER=`root`@`%` EVENT `UpdateAllfeedingdetail_4_hours` ON SCHEDULE EVERY 4 HOUR STARTS '2023-07-08 08:40:00' ON COMPLETION PRESERVE ENABLE COMMENT '归档配料明细' DO call UpdateAllfeedingdetail();
-- UpdateMostatus: scheduled event
CREATE DEFINER=`root`@`%` EVENT `UpdateMostatus` ON SCHEDULE EVERY 30 MINUTE STARTS '2023-07-07 16:56:53' ON COMPLETION NOT PRESERVE ENABLE DO call mes_sync.UpdateMostatus();
-- UpdateRecyclematerialouput: scheduled event
CREATE DEFINER=`root`@`%` EVENT `UpdateRecyclematerialouput` ON SCHEDULE EVERY 1 HOUR STARTS '2023-07-08 08:32:38' ON COMPLETION NOT PRESERVE ENABLE COMMENT '更新循环料产出' DO call UpdateRecyclematerialouput();
-- UpdateSiteOnlineYield_1_hours: scheduled event
CREATE DEFINER=`root`@`%` EVENT `UpdateSiteOnlineYield_1_hours` ON SCHEDULE EVERY 1 HOUR STARTS '2023-08-08 08:43:55' ON COMPLETION PRESERVE ENABLE COMMENT '更新产量' DO call UpdateSiteOnlineYield();