-- 业务表部分 开始
-- 检查整改表
delete from t_inspection;
-- 检查整改明细表
delete from t_inspection_line;
-- 应急演练、教育培训
delete from t_task_handin;
-- 任务下发
delete from t_task;
-- 案件材料报送
delete from t_prevent_material;
-- 风险提示
delete from t_prevent_risk;
-- 考核评价表
delete from t_assessment;
-- 考核评价明细表
delete from t_assessment_detail;
-- 值班备勤
delete from t_duty_records;
-- 值班备勤明细
delete from t_duty_records_lines;
-- 工作报备表
delete from t_work_filing;
-- 工作提醒表
delete from t_note_remind;
-- 非现场检查表
delete from t_scc_check;
--  非现场检查明细表
delete from t_scc_check_lines;
--  整改通知书表
delete from t_scc_unlocale_check;
--  整改通知书明细表
delete from t_scc_unlocale_check_line;
-- 联系接警记录表
delete from t_scc_answer_alarm;
-- 警情处理表
delete from t_scc_alarm_push;
-- 模板管理表
-- delete from t_file_template;
-- 法律法规表
delete from t_law;
-- 设备检查表
delete from t_device_inspection;
-- 设备检查明细表
delete from t_device_inspection_line;
-- 项目管理-预算
delete from t_budget_item;
-- 项目管理-项目信息
delete from t_project;
delete from t_project_check;
delete from t_project_contract;
delete from t_project_establishment;
delete from t_project_implementation;
delete from t_project_over_history;
delete from t_project_pay_plan;
delete from t_project_purchase;
delete from t_publicity;
-- 工作交接记录表
delete from t_handover_history;
-- 交接人员组
delete from t_work_handover_users;
-- 设备信息
delete from t_device;
-- 宣传报道
delete from t_publicity;
-- 相关方公司
delete from t_out_company;
-- 相关方人员
delete from t_out_employee;
delete from t_out_family;
delete from t_out_job_record;
-- 附件表中删除 除模板管理 以外的数据
delete from t_file where link_id not in (select id from t_file_template);
-- 业务表结束

-- >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

-- flowable业务表 开始
-- 历史流程实例
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;
-- 每一次执行（execution）可能带上的数据
delete from act_hi_tsk_log;
-- 历史流程变量
delete from act_hi_varinst;


-- 运行中的流程实例
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_history_job;
-- 运行时用户关系
delete from act_ru_identitylink;
-- 运行时作业表
delete from act_ru_job;
-- 暂停作业表
delete from act_ru_suspended_job;
-- 运行时任务表
delete from act_ru_task;
-- 定时作业表
delete from act_ru_timer_job;
-- 运行时变量表
delete from act_ru_variable;


-- 运行时流程执行实例
UPDATE act_ru_execution SET REV_ = '2';
update act_ru_execution set parent_id_ = null;
delete from act_ru_execution;
-- flowable业务表 结束

-- >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

