-- ----------------------------
-- 清空日志表中数据
-- ----------------------------
truncate table `iot_alert_log`;
truncate table `iot_device_log`;
truncate table `iot_event_log`;
truncate table `iot_function_log`;
truncate table `iot_simulate_log`;
truncate table `notify_log`;
truncate table `sys_job_log`;
truncate table `sys_logininfor`;
truncate table `sys_oper_log`;


truncate table iot_alert;
truncate table iot_alert_log;
truncate table iot_alert_notify_template;
truncate table iot_alert_scene;
truncate table iot_alert_trigger;
truncate table iot_category;
truncate table iot_device;
truncate table iot_device_abnormal;
truncate table iot_device_alert;
truncate table iot_device_alert_user;
truncate table iot_device_detail;
truncate table iot_device_group;
truncate table iot_device_history;
truncate table iot_device_imgs;
truncate table iot_device_inspection;
truncate table iot_device_job;
truncate table iot_device_lifecyle;
truncate table iot_device_log;
truncate table iot_device_log_buck;
truncate table iot_device_maintain;
truncate table iot_device_record;
truncate table iot_device_share;
truncate table iot_device_spare_part;
truncate table iot_device_template;
truncate table iot_device_user;
truncate table iot_event_log;
truncate table iot_firmware;
truncate table iot_firmware_task;
truncate table iot_firmware_task_detail;
truncate table iot_function_log;
truncate table iot_goview_project;
truncate table iot_goview_project_data;
truncate table iot_group;
truncate table iot_group_user;
truncate table iot_modbus_config;
truncate table iot_modbus_job;
truncate table iot_modbus_params;
truncate table iot_product;
truncate table iot_product_authorize;
truncate table iot_product_copy1;
truncate table iot_product_user;
truncate table iot_scene;
truncate table iot_scene_device;
truncate table iot_scene_eneregy;
truncate table iot_scene_maintainuser;
truncate table iot_scene_operation;
truncate table iot_scene_rule;
truncate table iot_scene_rule_value;
truncate table iot_scene_script;
truncate table iot_scene_trigger;
truncate table iot_script;
truncate table iot_script_bridge;
truncate table iot_script_user;
truncate table iot_simulate_log;
truncate table iot_sip_relation;
truncate table iot_social_platform;
truncate table iot_social_user;
truncate table iot_sub_gateway;
truncate table iot_things_model;
truncate table iot_things_model_template;
truncate table iot_things_model_template_translate;
truncate table iot_things_model_translate;
truncate table iot_var_temp;
truncate table iot_var_temp_salve;


delete from sys_role where role_id not in (1,2,3,4,5);
delete from sys_user where user_id not in (1);
delete from sys_role_dept where role_id not in (1,2,3,4,5);
delete from sys_user_role where role_id not in (1,2,3,4,5);
delete from sys_user_role where user_id not in (1);
delete from sys_dept where dept_id not in (100, 101, 102);
