SET FOREIGN_KEY_CHECKS = 0;

-- 清理流程数据
delete from	act_evt_log	;
delete from	act_ge_bytearray	;
-- delete from	act_ge_property	;
delete from	act_hi_actinst	;
delete from	act_hi_attachment	;
delete from	act_hi_comment	;
delete from	act_hi_detail	;
delete from	act_hi_entitylink	;
delete from	act_hi_identitylink	;
delete from	act_hi_procinst	;
delete from	act_hi_taskinst	;
delete from	act_hi_tsk_log	;
delete from	act_hi_varinst	;
delete from	act_id_bytearray	;
delete from	act_id_group	;
delete from	act_id_info	;
delete from	act_id_membership	;
delete from	act_id_priv	;
delete from	act_id_priv_mapping	;
-- delete from	act_id_property	;
delete from	act_id_token	;
delete from	act_id_user	;
delete from	act_procdef_info	;
delete from	act_re_deployment	;
delete from	act_re_model	;
delete from	act_ru_actinst	;
delete from	act_ru_deadletter_job	;
delete from	act_ru_entitylink	;
delete from	act_ru_event_subscr	;
delete from	act_ru_task	;
delete from	act_ru_identitylink	;
delete from	act_ru_variable	;
delete from	act_ru_execution	;
delete from	act_ru_external_job	;
delete from	act_ru_history_job	;
delete from	act_ru_job	;
delete from	act_ru_suspended_job	;
delete from	act_ru_timer_job	;
delete from	act_re_procdef	;


-- 清理流程单据测试数据
delete from ext_biz_leave;
delete from joa_busines_strip;
delete from joa_doc_sending;
delete from joa_employee_leave;
delete from joa_loan;
delete from demo_sub_flow_hq;
delete from ceshi_des_qingjia;
delete from joa_onl_leave;
delete from oa_demo_bhan_wguan;
delete from ce_fenzhi_zx;
delete from ce_paita_wangguan;
delete from ceshi_subqt;
delete from ceshi_ruzhi;
delete from oa_demo_bhan_wguan;

delete from ext_act_flow_data;
delete from ext_act_process_node_deploy;
delete from ext_act_task_cc;
delete from ext_act_bpm_log;
delete from ext_act_bpm_file;
delete from ext_act_mutil_flow_data;
delete from ext_act_task_notification;

update ext_act_process set process_status = 0;

-- 清理表单设计器
delete from  ext_act_design_flow_data;
delete from  design_form_data;

-- 清理简流的测试流程
-- delete from ext_act_process where process_json is not null;
-- delete from  ext_act_process_form where process_id not in (select id from ext_act_process);
-- delete from  ext_act_process_node where process_id not in (select id from ext_act_process);
-- delete from  ext_act_process_node_auth where process_id not in (select id from ext_act_process);
-- delete from  ext_act_process_node_deploy where process_id not in (select id from ext_act_process);
-- delete from  design_form where tenant_id > 1;

SET FOREIGN_KEY_CHECKS = 1;

-- 清空系统日志
delete from 	sys_log	;

-- 清理公告和消息中心
delete from sys_announcement	;
delete from sys_announcement_send	;
delete from sys_sms;

-- 清空OA工单的表业务数据
delete from 	oa_become_regular	;
delete from 	oa_business_travel	;
delete from 	oa_business_travel_accompanied	;
delete from 	oa_car_info	;
delete from 	oa_car_use	;
delete from 	oa_dimission	;
delete from 	oa_employee_award	;
delete from 	oa_employee_certificate	;
delete from 	oa_employee_education	;
delete from 	oa_employee_experience	;
delete from 	oa_employee_family	;
delete from 	oa_employee_info	;
delete from 	oa_employee_relations	;
delete from 	oa_employment	;
delete from 	oa_employment_apply	;
delete from 	oa_interview	;
delete from 	oa_leave	;
delete from 	oa_overtime	;
delete from 	oa_promotion	;
delete from 	oa_security_vehicle	;
delete from 	oa_sign_info	;
delete from 	oa_sign_out	;
delete from 	oa_sign_patch	;
delete from 	oa_sign_rule	;
delete from 	oa_supplies_detail	;
delete from 	oa_supplies_use	;


-- 清空在线聊天数据
delete from 	eoa_chat_group	;
delete from 	eoa_chat_off_message	;
delete from 	eoa_chat_on_message	;
delete from 	eoa_chat_on_message_his	;
delete from 	eoa_chat_session	;
delete from 	eoa_chat_user	;
delete from 	eoa_chat_user_group	;