-- ============================================================================
-- ylrz_saas 租户表清理脚本（安全版）
-- 前提: 所有租户已有独立数据库，租户数据已在独立库中
-- 安全规则:
--   1. 表必须存在于 ylrz_saas_tenant_1 参考库中（已备份验证）
--   2. 表不是 admin 模块直接使用的（sys_/tenant_/proxy_ 等）
--   3. 表不是 Bridge 控制器通过 JdbcTemplate 访问的
--   4. 表不是双模块共享的（company_user, qw_user 等）
-- ============================================================================

-- 执行前验证: 确认所有租户数据库正常运行
-- SELECT id, tenant_name, db_url, db_name FROM tenant_info;

-- ============================================================================
-- 待删除表（按前缀分组，共 388 张）
-- ============================================================================

-- --- ad_domain_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`ad_domain`;

-- --- ad_dy_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`ad_dy_account`;
DROP TABLE IF EXISTS `ylrz_saas`.`ad_dy_api`;

-- --- ad_html_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`ad_html_template`;

-- --- ad_iqiyi_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`ad_iqiyi_account`;

-- --- ad_site_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`ad_site`;

-- --- ad_upload_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`ad_upload_log`;

-- --- ad_youku_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`ad_youku_account`;

-- --- bd_api_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`bd_api`;

-- --- bd_creative_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`bd_creative_statistics`;

-- --- bd_report_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`bd_report_data`;

-- --- chat_dataset_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`chat_dataset`;
DROP TABLE IF EXISTS `ylrz_saas`.`chat_dataset_file`;

-- --- chat_keyword_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`chat_keyword`;

-- --- chat_msg_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`chat_msg`;
DROP TABLE IF EXISTS `ylrz_saas`.`chat_msg_logs`;

-- --- chat_role_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`chat_role`;

-- --- chat_session_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`chat_session`;

-- --- chat_user_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`chat_user`;

-- --- cid_ipad_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`cid_ipad_server`;
DROP TABLE IF EXISTS `ylrz_saas`.`cid_ipad_server_user`;

-- --- company_ai_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`company_ai_workflow_node_type`;

-- --- company_company_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`company_company_fsuser`;

-- --- company_deduct_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`company_deduct`;

-- --- company_div_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`company_div_config`;
DROP TABLE IF EXISTS `ylrz_saas`.`company_div_item`;

-- --- company_logininfor_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`company_logininfor`;

-- --- company_miniapp_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`company_miniapp`;

-- --- company_post_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`company_post`;

-- --- company_profit_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`company_profit_logs`;

-- --- company_recharge_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`company_recharge`;

-- --- company_role_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`company_role_dept`;
DROP TABLE IF EXISTS `ylrz_saas`.`company_role_menu`;

-- --- company_sop_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`company_sop_role`;

-- --- company_tag_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`company_tag`;
DROP TABLE IF EXISTS `ylrz_saas`.`company_tag_user`;

-- --- company_tcm_* (3 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`company_tcm_consume`;
DROP TABLE IF EXISTS `ylrz_saas`.`company_tcm_report`;
DROP TABLE IF EXISTS `ylrz_saas`.`company_tcm_schedule`;

-- --- company_user_* (5 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`company_user_card`;
DROP TABLE IF EXISTS `ylrz_saas`.`company_user_change_apply_user`;
DROP TABLE IF EXISTS `ylrz_saas`.`company_user_delay_time`;
DROP TABLE IF EXISTS `ylrz_saas`.`company_user_post`;
DROP TABLE IF EXISTS `ylrz_saas`.`company_user_user`;

-- --- company_voice_* (7 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`company_voice`;
DROP TABLE IF EXISTS `ylrz_saas`.`company_voice_config`;
DROP TABLE IF EXISTS `ylrz_saas`.`company_voice_dialog`;
DROP TABLE IF EXISTS `ylrz_saas`.`company_voice_mobile`;
DROP TABLE IF EXISTS `ylrz_saas`.`company_voice_package`;
DROP TABLE IF EXISTS `ylrz_saas`.`company_voice_robotic_call_log_addwx`;
DROP TABLE IF EXISTS `ylrz_saas`.`company_voice_robotic_call_log_sendmsg`;

-- --- company_workflow_* (4 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`company_workflow_lobster`;
DROP TABLE IF EXISTS `ylrz_saas`.`company_workflow_lobster_edge`;
DROP TABLE IF EXISTS `ylrz_saas`.`company_workflow_lobster_node`;
DROP TABLE IF EXISTS `ylrz_saas`.`company_workflow_lobster_task`;

-- --- company_wx_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`company_wx_chat`;
DROP TABLE IF EXISTS `ylrz_saas`.`company_wx_user_group`;

-- --- crm_customer_* (8 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`crm_customer_analyze`;
DROP TABLE IF EXISTS `ylrz_saas`.`crm_customer_assign`;
DROP TABLE IF EXISTS `ylrz_saas`.`crm_customer_contacts`;
DROP TABLE IF EXISTS `ylrz_saas`.`crm_customer_ext`;
DROP TABLE IF EXISTS `ylrz_saas`.`crm_customer_his_order`;
DROP TABLE IF EXISTS `ylrz_saas`.`crm_customer_logs`;
DROP TABLE IF EXISTS `ylrz_saas`.`crm_customer_third`;
DROP TABLE IF EXISTS `ylrz_saas`.`crm_customer_user`;

-- --- crm_event_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`crm_event`;

-- --- crm_msg_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`crm_msg`;

-- --- customer_transfer_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`customer_transfer_approval`;

-- --- fastgpt_chat_* (6 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fastgpt_chat_artificial_words`;
DROP TABLE IF EXISTS `ylrz_saas`.`fastgpt_chat_keyword`;
DROP TABLE IF EXISTS `ylrz_saas`.`fastgpt_chat_msg_logs`;
DROP TABLE IF EXISTS `ylrz_saas`.`fastgpt_chat_replace_text`;
DROP TABLE IF EXISTS `ylrz_saas`.`fastgpt_chat_replace_words`;
DROP TABLE IF EXISTS `ylrz_saas`.`fastgpt_chat_voice_homo`;

-- --- fastgpt_collection_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fastgpt_collection`;

-- --- fastgpt_collention_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fastgpt_collention_data`;

-- --- fastgpt_dataset_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fastgpt_dataset`;

-- --- fastgpt_event_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fastgpt_event_log`;
DROP TABLE IF EXISTS `ylrz_saas`.`fastgpt_event_log_total`;

-- --- fastgpt_ext_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fastgpt_ext_user_tag`;

-- --- fastgpt_keyword_* (3 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fastgpt_keyword`;
DROP TABLE IF EXISTS `ylrz_saas`.`fastgpt_keyword_artificial`;
DROP TABLE IF EXISTS `ylrz_saas`.`fastgpt_keyword_send`;

-- --- fastgpt_push_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fastgpt_push_token_total`;

-- --- fastgpt_role_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fastgpt_role_tag`;

-- --- fastgpt_tag_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fastgpt_tag`;
DROP TABLE IF EXISTS `ylrz_saas`.`fastgpt_tag_group`;

-- --- fastgpt_user_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fastgpt_user`;

-- --- fs_adv_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_adv_sem`;

-- --- fs_ai_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_ai_workflow_edge`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_ai_workflow_node_type`;

-- --- fs_app_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_app_version`;

-- --- fs_article_* (3 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_article`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_article_cate`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_article_views`;

-- --- fs_chinese_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_chinese_medicine`;

-- --- fs_complaint_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_complaint_template`;

-- --- fs_coupon_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_coupon`;

-- --- fs_course_* (12 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_course_domain_name`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_course_finish_temp`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_course_finish_temp_parent`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_course_link`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_course_product`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_course_product_order`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_course_question_bank`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_course_question_category`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_course_sop`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_course_sop_app_link`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_course_sop_logs`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_course_watch_comment`;

-- --- fs_df_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_df_account`;

-- --- fs_disease_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_disease`;

-- --- fs_doctor_* (13 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_doctor_ai_chat_log`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_doctor_ai_chat_msg`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_doctor_ai_chat_session`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_doctor_article`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_doctor_article_cate`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_doctor_bill`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_doctor_confirm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_doctor_extract`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_doctor_oper_log`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_doctor_prescribe`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_doctor_prescribe_drug`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_doctor_price`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_doctor_words`;

-- --- fs_drug_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_drug_report`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_drug_report_count`;

-- --- fs_famous_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_famous_prescribe`;

-- --- fs_finish_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_finish_course_statistics_sync`;

-- --- fs_first_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_first_diagnosis`;

-- --- fs_follow_* (3 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_follow`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_follow_report`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_follow_temp`;

-- --- fs_health_* (5 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_health_data`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_health_history_temp`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_health_life`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_health_record`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_health_tongue`;

-- --- fs_hfpay_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_hfpay_config`;

-- --- fs_icd_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_icd`;

-- --- fs_illness_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_illness_library`;

-- --- fs_im_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_im_msg_send_detail`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_im_msg_send_log`;

-- --- fs_inquiry_* (7 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_inquiry_disease`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_inquiry_order_logs`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_inquiry_order_media`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_inquiry_order_msg`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_inquiry_order_ping`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_inquiry_patient_info`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_inquiry_temp`;

-- --- fs_integral_* (3 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_integral_cart`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_integral_order`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_integral_order_logs`;

-- --- fs_interest_* (4 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_interest_ai_msg`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_interest_ai_role`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_interest_ai_role_words`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_interest_ai_session`;

-- --- fs_material_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_material`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_material_group`;

-- --- fs_medicated_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_medicated_food`;

-- --- fs_mess_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_mess_temp`;

-- --- fs_package_* (3 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_package_cate`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_package_favorite`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_package_solar_term`;

-- --- fs_physical_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_physical_report_template`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_physical_report_template_field`;

-- --- fs_promotional_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_promotional_active`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_promotional_active_log`;

-- --- fs_question_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_question_and_answer`;

-- --- fs_questions_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_questions`;

-- --- fs_statis_* (5 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_statis_qw_temp_param`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_statis_qw_watch`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_statis_saler_watch`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_statis_temp_fsuser`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_statis_temp_param`;

-- --- fs_statistics_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_statistics`;

-- --- fs_store_* (39 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_activity`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_activity_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_after_sales`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_after_sales_item`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_after_sales_logs`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_after_sales_logs_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_bill`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_bill_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_canvas_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_cart_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_coupon_issue_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_coupon_issue_user_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_coupon_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_coupon_user_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_extract`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_order_audit_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_order_bill_log`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_order_logs`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_order_logs_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_order_notice_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_payment_error`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_product_attr`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_product_attr_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_product_attr_value`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_product_category`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_product_details_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_product_group`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_product_group_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_product_package`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_product_purchase_limit_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_product_relation_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_product_reply_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_product_rule_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_product_template_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_recommend_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_shop_staff_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_sub_order`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_store_visit_scrm`;

-- --- fs_test_* (3 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_test_report`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_test_temp`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_test_temp_item`;

-- --- fs_tongue_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_tongue_info`;

-- --- fs_user_* (51 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_address`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_bill`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_company_bind`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_company_package_scrm`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_company_user`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_company_user_qw`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_complaint`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_complaint_msg`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_course_comment`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_course_comment_like`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_course_company_statistics`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_course_complaint_record`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_course_complaint_type`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_course_count`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_course_favorite`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_course_follow`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_course_like`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_course_note`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_course_note_like`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_course_note_save`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_course_order`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_course_study`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_course_study_log`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_course_video_red_package`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_doctor`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_extract`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_information_collection_schedule`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_integral_logs`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_invited`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_login_log`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_new_task`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_online_state`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_operation_log`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_project_tag`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_recharge`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_sign`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_talent`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_talent_follow`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_video`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_video_comment`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_video_comment_like`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_video_favorite`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_video_like`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_video_tags`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_video_view`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_vip_order`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_vip_package`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_watch`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_watch_course_statistics`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_watch_statistics`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_user_wx`;

-- --- fs_vessel_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_vessel`;

-- --- fs_video_* (3 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_video_barrage`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_video_course_tag`;
DROP TABLE IF EXISTS `ylrz_saas`.`fs_video_resource`;

-- --- fs_wechat_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`fs_wechat_template`;

-- --- hy_watch_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`hy_watch_log`;

-- --- hy_work_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`hy_work_task`;

-- --- live_after_* (3 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`live_after_sales`;
DROP TABLE IF EXISTS `ylrz_saas`.`live_after_sales_item`;
DROP TABLE IF EXISTS `ylrz_saas`.`live_after_sales_logs`;

-- --- live_anchor_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`live_anchor`;

-- --- live_auto_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`live_auto_task`;

-- --- live_cart_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`live_cart`;

-- --- live_completion_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`live_completion_points_record`;

-- --- live_coupon_* (5 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`live_coupon`;
DROP TABLE IF EXISTS `ylrz_saas`.`live_coupon_issue`;
DROP TABLE IF EXISTS `ylrz_saas`.`live_coupon_issue_relation`;
DROP TABLE IF EXISTS `ylrz_saas`.`live_coupon_issue_user`;
DROP TABLE IF EXISTS `ylrz_saas`.`live_coupon_user`;

-- --- live_data_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`live_data`;

-- --- live_event_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`live_event_conf`;

-- --- live_gift_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`live_gift`;

-- --- live_goods_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`live_goods`;

-- --- live_lottery_* (3 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`live_lottery_conf`;
DROP TABLE IF EXISTS `ylrz_saas`.`live_lottery_product_conf`;
DROP TABLE IF EXISTS `ylrz_saas`.`live_lottery_registration`;

-- --- live_msg_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`live_msg`;

-- --- live_order_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`live_order_logs`;
DROP TABLE IF EXISTS `ylrz_saas`.`live_order_payment_error`;

-- --- live_red_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`live_red_conf`;

-- --- live_reward_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`live_reward_record`;

-- --- live_sensitive_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`live_sensitive_words`;

-- --- live_tag_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`live_tag_config`;

-- --- live_traffic_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`live_traffic_log`;

-- --- live_user_* (6 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`live_user_favorite`;
DROP TABLE IF EXISTS `ylrz_saas`.`live_user_first_entry`;
DROP TABLE IF EXISTS `ylrz_saas`.`live_user_follow`;
DROP TABLE IF EXISTS `ylrz_saas`.`live_user_like`;
DROP TABLE IF EXISTS `ylrz_saas`.`live_user_lottery_record`;
DROP TABLE IF EXISTS `ylrz_saas`.`live_user_red_record`;

-- --- live_watch_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`live_watch_log`;
DROP TABLE IF EXISTS `ylrz_saas`.`live_watch_user`;

-- --- lobster_compliance_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`lobster_compliance_rule`;

-- --- lobster_conversation_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`lobster_conversation_summary`;

-- --- lobster_node_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`lobster_node_execution_log`;

-- --- lobster_workflow_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`lobster_workflow_instance`;

-- --- lucky_bag_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`lucky_bag`;
DROP TABLE IF EXISTS `ylrz_saas`.`lucky_bag_collect_record`;

-- --- qw_app_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_app_contact_way`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_app_contact_way_logs`;

-- --- qw_auto_* (3 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_auto_tags`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_auto_tags_logs`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_auto_tags_rules`;

-- --- qw_contact_* (5 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_contact_batch`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_contact_way`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_contact_way_group`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_contact_way_logs`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_contact_way_user`;

-- --- qw_course_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_course_finish_remark_rty`;

-- --- qw_customer_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_customer_property`;

-- --- qw_drainage_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_drainage_link`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_drainage_link_logs`;

-- --- qw_external_* (7 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_external_ai_analyze`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_external_contact_black_log`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_external_contact_crm`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_external_contact_transfer_company_audit`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_external_contact_transfer_company_audit_user`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_external_contact_transfer_log`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_external_err_retry`;

-- --- qw_friend_* (6 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_friend_circle`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_friend_circle_task`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_friend_comments`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_friend_customer_list`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_friend_welcome`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_friend_welcome_item`;

-- --- qw_group_* (5 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_group_chat`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_group_chat_transfer_log`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_group_msg`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_group_msg_item`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_group_msg_user`;

-- --- qw_groupchat_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_groupchat_statistic`;

-- --- qw_information_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_information`;

-- --- qw_ipad_* (3 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_ipad_server`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_ipad_server_log`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_ipad_server_user`;

-- --- qw_material_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_material`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_material_group`;

-- --- qw_messages_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_messages`;

-- --- qw_msg_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_msg`;

-- --- qw_push_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_push_count`;

-- --- qw_session_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_session`;

-- --- qw_sop_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_sop_logs_detalis`;

-- --- qw_tag_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_tag_group`;

-- --- qw_user_* (3 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_user_complain_record`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_user_video`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_user_voice_log`;

-- --- qw_userbehavior_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_userbehavior_data`;

-- --- qw_welcome_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_welcome`;

-- --- qw_work_* (3 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`qw_work_link`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_work_link_user`;
DROP TABLE IF EXISTS `ylrz_saas`.`qw_work_user`;

-- --- tulin_info_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`tulin_info_sync_log`;

-- --- uni_push_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`uni_push_log`;

-- --- watch_beginner_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`watch_beginner_guide`;

-- --- watch_device_* (4 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`watch_device_account`;
DROP TABLE IF EXISTS `ylrz_saas`.`watch_device_day`;
DROP TABLE IF EXISTS `ylrz_saas`.`watch_device_info`;
DROP TABLE IF EXISTS `ylrz_saas`.`watch_device_setup`;

-- --- watch_family_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`watch_family_user`;

-- --- watch_materials_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`watch_materials`;
DROP TABLE IF EXISTS `ylrz_saas`.`watch_materials_type`;

-- --- watch_medication_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`watch_medication_task`;

-- --- watch_monitor_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`watch_monitor_data_type`;

-- --- watch_msg_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`watch_msg_set`;

-- --- watch_send_* (2 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`watch_send_msg_log`;
DROP TABLE IF EXISTS `ylrz_saas`.`watch_send_msg_set`;

-- --- watch_user_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`watch_user`;

-- --- wx_contact_* (1 tables) ---
DROP TABLE IF EXISTS `ylrz_saas`.`wx_contact`;

-- ============================================================================
-- 执行后验证
-- ============================================================================
-- SELECT COUNT(*) AS remaining FROM information_schema.tables
-- WHERE table_schema='ylrz_saas' AND table_type='BASE TABLE';
-- Expected: ~205

-- ============================================================================
-- 保留在 ylrz_saas 的表（共 205 张）
-- ============================================================================
--   ad_account
--   ad_html_click_log
--   ai_knowledge_base
--   bd_account
--   bd_creative
--   bd_plan
--   bd_unit
--   billing_detail
--   billing_statement
--   company
--   company_ai_provider
--   company_config
--   company_dept
--   company_domain
--   company_domain_bind
--   company_domain_bind_user
--   company_menu
--   company_money_logs
--   company_oper_log
--   company_profit
--   company_red_packet_balance_logs
--   company_role
--   company_sms
--   company_sms_logs
--   company_sms_order
--   company_sms_package
--   company_sms_temp
--   company_user
--   company_user_change_apply
--   company_user_role
--   company_voice_api
--   company_voice_blacklist
--   company_voice_caller
--   company_voice_logs
--   company_voice_package_order
--   company_voice_robotic
--   company_voice_robotic_call_blacklist
--   company_voice_robotic_call_log_callphone
--   company_voice_robotic_callees
--   company_voice_robotic_wx
--   company_workflow_lobster_record
--   company_workflow_lobster_variable
--   company_wx_account
--   company_wx_client
--   company_wx_dialog
--   company_wx_user
--   consume_type
--   crm_customer
--   crm_customer_visit
--   databasechangelog
--   databasechangeloglock
--   db_config
--   fastgpt_chat_msg
--   fastgpt_chat_session
--   fastgpt_event_token_log
--   fastgpt_role
--   fee_plan
--   fee_plan_flow_tier
--   fee_plan_item
--   fs_adv
--   fs_ai_workflow
--   fs_ai_workflow_company_user
--   fs_ai_workflow_company_voice
--   fs_ai_workflow_node
--   fs_app_contact_way
--   fs_barrage_package_order
--   fs_city
--   fs_course_answer_logs
--   fs_course_play_source_config
--   fs_course_red_packet_log
--   fs_course_traffic_log
--   fs_course_watch_log
--   fs_department
--   fs_doctor
--   fs_doctor_product
--   fs_export_task
--   fs_express
--   fs_home_article
--   fs_home_article_category
--   fs_home_article_view
--   fs_hospital
--   fs_inquiry_order
--   fs_inquiry_order_hs_log
--   fs_inquiry_order_report
--   fs_integral_goods
--   fs_menu
--   fs_package
--   fs_package_order
--   fs_patient
--   fs_prescribe
--   fs_prescribe_drug
--   fs_role_menu
--   fs_shipping_templates
--   fs_shipping_templates_free
--   fs_shipping_templates_region
--   fs_statistics_index
--   fs_store_after_sales_item_scrm
--   fs_store_after_sales_scrm
--   fs_store_after_sales_status_scrm
--   fs_store_order
--   fs_store_order_df
--   fs_store_order_item
--   fs_store_order_item_scrm
--   fs_store_order_offline_item_scrm
--   fs_store_order_offline_scrm
--   fs_store_order_scrm
--   fs_store_order_status_scrm
--   fs_store_payment
--   fs_store_payment_scrm
--   fs_store_product
--   fs_store_product_attr_value_scrm
--   fs_store_product_category_scrm
--   fs_store_product_package_scrm
--   fs_store_product_scrm
--   fs_store_scrm
--   fs_store_shop_scrm
--   fs_user
--   fs_user_coupon
--   fs_user_course
--   fs_user_course_category
--   fs_user_course_company_user_time
--   fs_user_course_period
--   fs_user_course_period_days
--   fs_user_course_training_camp
--   fs_user_course_video
--   fs_user_information_collection
--   fs_user_promoter_apply
--   gen_table
--   gen_table_column
--   ipad_allocation_records
--   live
--   live_company_code
--   live_order
--   live_order_df
--   live_order_item
--   live_order_payment
--   live_video
--   merchant_app_config
--   payment_mini_program_config
--   platform_statistics
--   proxy
--   proxy_oper_log
--   proxy_service_price
--   proxy_tenant_quota
--   proxy_tenant_rel
--   proxy_withdraw
--   qrtz_blob_triggers
--   qrtz_calendars
--   qrtz_cron_triggers
--   qrtz_fired_triggers
--   qrtz_job_details
--   qrtz_locks
--   qrtz_paused_trigger_grps
--   qrtz_scheduler_state
--   qrtz_simple_triggers
--   qrtz_simprop_triggers
--   qrtz_triggers
--   qw_api_sop_log_token
--   qw_company
--   qw_dept
--   qw_external_contact
--   qw_external_contact_info
--   qw_group_chat_user
--   qw_ipad_total
--   qw_restriction_push_record
--   qw_sop
--   qw_sop_temp
--   qw_tag
--   qw_user
--   qw_watch_log
--   qw_work_task
--   service_fee_config
--   sop_user_logs
--   sop_user_logs_info
--   sys_config
--   sys_dept
--   sys_dict_data
--   sys_dict_type
--   sys_job
--   sys_job_log
--   sys_keyword
--   sys_logininfor
--   sys_menu
--   sys_notice
--   sys_oper_log
--   sys_oper_log_scrm
--   sys_post
--   sys_role
--   sys_role_dept
--   sys_role_menu
--   sys_user
--   sys_user_post
--   sys_user_role
--   sys_user_set
--   tenant_balance
--   tenant_company_menu
--   tenant_consume_record
--   tenant_info
--   tenant_info_stats
--   tenant_module_usage
--   tenant_sql_execute_record
--   tenant_sys_menu
--   tenant_wallet
--   usage_event
--   vc_company_user
