Files
yunzerwebsiteallinone/go/docs/sql/insert_backend_dict_data.sql
T
2026-09-28 23:16:26 +08:00

449 lines
53 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- =============================================================
-- 租户端数据字典 —— 初始数据(系统内置,全局共享)
--
-- 表:yz_backend_dict / yz_backend_dict_item(建表见 create_dict.sql)
--
-- 重要:本文件写入的是 tenant_id = '0' 的「全局内置字典」,与 yz_system_admin_role
-- 中 tenant_id=0 的全局租户角色同一套约定:
-- - 所有租户都能通过 /backend/dict/options/:code 读到;
-- - 租户若需要改动,请按相同 dict_code 新建一份自己的字典(读接口优先取租户自己的,
-- 字典管理页里全局字典显示为「内置」只读)。
--
-- 内容来源:backend 前端散落的硬编码映射,其中 CRM 部分取自 views/apps/crm/dict.js。
-- 幂等:字典按 (tenant_id='0', dict_code) 判重,字典项按 (dict_id, item_value) 判重,可重复执行。
-- 说明:未给出标签色的字典项 tag_type 留空,可在「系统设置 → 数据字典」里按需补。
-- =============================================================
SET NAMES utf8mb4;
-- =============================================================
-- 1. 字典列表(全局内置)
-- =============================================================
INSERT INTO `yz_backend_dict` (`tenant_id`, `dict_name`, `dict_code`, `remark`, `sort`, `status`, `create_user_id`, `create_time`)
SELECT '0', t.dict_name, t.dict_code, t.remark, t.sort, 1, 'sql', NOW()
FROM (
SELECT '通用状态' AS dict_name, 'common_status' AS dict_code, '0 禁用 / 1 正常 / 2 冻结 / 3 已注销(客户、供应商等共用)' AS remark, 10 AS sort
UNION ALL SELECT '往来单位等级' AS dict_name, 'common_object_level' AS dict_code, '客户/供应商等级' AS remark, 20 AS sort
UNION ALL SELECT '性别' AS dict_name, 'common_gender' AS dict_code, '0 未知 / 1 男 / 2 女' AS remark, 30 AS sort
UNION ALL SELECT '通用启用状态' AS dict_name, 'common_enable_status' AS dict_code, '1 启用 / 0 禁用' AS remark, 40 AS sort
UNION ALL SELECT '待办状态' AS dict_name, 'common_todo_status' AS dict_code, '0 待办 / 1 已完成' AS remark, 50 AS sort
UNION ALL SELECT '优先级' AS dict_name, 'common_priority' AS dict_code, '日程优先级' AS remark, 60 AS sort
UNION ALL SELECT '联系人类型' AS dict_name, 'common_contact_type' AS dict_code, '1 企业 / 2 个人' AS remark, 70 AS sort
UNION ALL SELECT '提醒渠道' AS dict_name, 'common_notify_channel' AS dict_code, '站内提醒的推送渠道(remind_channels)' AS remark, 80 AS sort
UNION ALL SELECT '移入公海原因' AS dict_name, 'crm_pool_reason' AS dict_code, 'CRM 客户移入公海的原因' AS remark, 90 AS sort
UNION ALL SELECT '联系人关联类型' AS dict_name, 'erp_related_type' AS dict_code, '1 客户 / 2 供应商' AS remark, 100 AS sort
UNION ALL SELECT '客户类型' AS dict_name, 'erp_customer_type' AS dict_code, 'crm/dict.js CUSTOMER_TYPE_OPTIONS' AS remark, 110 AS sort
UNION ALL SELECT '供应商类型' AS dict_name, 'erp_supplier_type' AS dict_code, '与 CRM 供应商类型共用' AS remark, 120 AS sort
UNION ALL SELECT '线索来源' AS dict_name, 'crm_clue_source' AS dict_code, '' AS remark, 130 AS sort
UNION ALL SELECT '线索状态' AS dict_name, 'crm_clue_status' AS dict_code, '' AS remark, 140 AS sort
UNION ALL SELECT '线索级别' AS dict_name, 'crm_clue_level' AS dict_code, '' AS remark, 150 AS sort
UNION ALL SELECT '商机阶段' AS dict_name, 'crm_business_stage' AS dict_code, '' AS remark, 160 AS sort
UNION ALL SELECT '商机状态' AS dict_name, 'crm_business_status' AS dict_code, '' AS remark, 170 AS sort
UNION ALL SELECT '跟进类型' AS dict_name, 'crm_follow_type' AS dict_code, '' AS remark, 180 AS sort
UNION ALL SELECT '跟进关联类型' AS dict_name, 'crm_pipeline_related_type' AS dict_code, '' AS remark, 190 AS sort
UNION ALL SELECT '项目状态' AS dict_name, 'crm_project_status' AS dict_code, '' AS remark, 200 AS sort
UNION ALL SELECT '项目类型' AS dict_name, 'crm_project_type' AS dict_code, '' AS remark, 210 AS sort
UNION ALL SELECT '合同分类' AS dict_name, 'crm_contract_category' AS dict_code, '' AS remark, 220 AS sort
UNION ALL SELECT '合同状态' AS dict_name, 'crm_contract_status' AS dict_code, '' AS remark, 230 AS sort
UNION ALL SELECT '合同形式' AS dict_name, 'crm_contract_party_count' AS dict_code, '2 双方 / 3 三方 / 4 四方' AS remark, 240 AS sort
UNION ALL SELECT '我方角色' AS dict_name, 'crm_contract_our_role' AS dict_code, '' AS remark, 250 AS sort
UNION ALL SELECT '合同产品类别' AS dict_name, 'crm_contract_product_category' AS dict_code, '' AS remark, 260 AS sort
UNION ALL SELECT '回款周期' AS dict_name, 'crm_payback_cycle' AS dict_code, '' AS remark, 270 AS sort
UNION ALL SELECT '回款方式' AS dict_name, 'crm_payback_method' AS dict_code, '' AS remark, 280 AS sort
UNION ALL SELECT '回款计划状态' AS dict_name, 'crm_payback_status' AS dict_code, '' AS remark, 290 AS sort
UNION ALL SELECT '回款明细状态' AS dict_name, 'crm_payback_item_status' AS dict_code, '' AS remark, 300 AS sort
UNION ALL SELECT '产品状态' AS dict_name, 'crm_product_status' AS dict_code, '1 启用 / 0 停用' AS remark, 310 AS sort
UNION ALL SELECT '产品单位' AS dict_name, 'crm_product_unit' AS dict_code, '计量单位,偏业务参数,可自行增删' AS remark, 320 AS sort
UNION ALL SELECT '产品研发方式' AS dict_name, 'crm_product_dev_mode' AS dict_code, '' AS remark, 330 AS sort
UNION ALL SELECT '招标状态' AS dict_name, 'crm_tender_status' AS dict_code, '' AS remark, 340 AS sort
UNION ALL SELECT '招标方式' AS dict_name, 'crm_tender_type' AS dict_code, '' AS remark, 350 AS sort
UNION ALL SELECT '招标结果' AS dict_name, 'crm_tender_result_type' AS dict_code, '' AS remark, 360 AS sort
UNION ALL SELECT '招标供应商状态' AS dict_name, 'crm_tender_supplier_status' AS dict_code, '' AS remark, 370 AS sort
UNION ALL SELECT '招标公告类型' AS dict_name, 'crm_tender_announce_type' AS dict_code, '' AS remark, 380 AS sort
UNION ALL SELECT '评标方式' AS dict_name, 'crm_evaluation_method' AS dict_code, '' AS remark, 390 AS sort
UNION ALL SELECT '评标结果' AS dict_name, 'crm_evaluation_result' AS dict_code, '' AS remark, 400 AS sort
UNION ALL SELECT '投标状态' AS dict_name, 'crm_bid_status' AS dict_code, '' AS remark, 410 AS sort
UNION ALL SELECT '投标方式' AS dict_name, 'crm_bid_type' AS dict_code, '' AS remark, 420 AS sort
UNION ALL SELECT '投标来源' AS dict_name, 'crm_bid_source_type' AS dict_code, '' AS remark, 430 AS sort
UNION ALL SELECT '投标结果' AS dict_name, 'crm_bid_result_type' AS dict_code, '' AS remark, 440 AS sort
UNION ALL SELECT '投标任务类型' AS dict_name, 'crm_bid_task_type' AS dict_code, '' AS remark, 450 AS sort
UNION ALL SELECT '投标任务状态' AS dict_name, 'crm_bid_task_status' AS dict_code, '' AS remark, 460 AS sort
UNION ALL SELECT '投标模板类型' AS dict_name, 'crm_bid_template_type' AS dict_code, '' AS remark, 470 AS sort
UNION ALL SELECT '投标报价状态' AS dict_name, 'crm_bid_quote_status' AS dict_code, '' AS remark, 480 AS sort
UNION ALL SELECT '投标文件状态' AS dict_name, 'crm_bid_document_status' AS dict_code, '' AS remark, 490 AS sort
UNION ALL SELECT '投标费用类型' AS dict_name, 'crm_bid_expense_type' AS dict_code, '' AS remark, 500 AS sort
UNION ALL SELECT '竞争对手类型' AS dict_name, 'crm_competitor_type' AS dict_code, '' AS remark, 510 AS sort
UNION ALL SELECT '资质类型' AS dict_name, 'crm_qualification_type' AS dict_code, '' AS remark, 520 AS sort
UNION ALL SELECT '资质状态' AS dict_name, 'crm_qualification_status' AS dict_code, '' AS remark, 530 AS sort
UNION ALL SELECT '收付款状态' AS dict_name, 'crm_payment_status' AS dict_code, '' AS remark, 540 AS sort
UNION ALL SELECT '审批类型' AS dict_name, 'crm_approval_type' AS dict_code, '' AS remark, 550 AS sort
UNION ALL SELECT '审批状态' AS dict_name, 'crm_approval_status' AS dict_code, '' AS remark, 560 AS sort
UNION ALL SELECT '账套会计准则' AS dict_name, 'erp_account_set_standard' AS dict_code, '1 企业会计准则 / 2 小企业会计准则' AS remark, 570 AS sort
UNION ALL SELECT '账套本位币' AS dict_name, 'erp_account_set_currency' AS dict_code, '账套支持的币种' AS remark, 580 AS sort
UNION ALL SELECT '职位类型' AS dict_name, 'erp_position_type' AS dict_code, '0 普通职位 / 1 主管 / 2 负责人' AS remark, 590 AS sort
UNION ALL SELECT '员工账号状态' AS dict_name, 'common_employee_status' AS dict_code, '1 正常 / 0 禁用 / 2 离职' AS remark, 600 AS sort
UNION ALL SELECT '用工状态' AS dict_name, 'oa_employee_hire_status' AS dict_code, '人事档案:1 试用 / 2 正式 / 3 离职' AS remark, 610 AS sort
UNION ALL SELECT '婚姻状况' AS dict_name, 'oa_employee_marital' AS dict_code, '人事档案' AS remark, 620 AS sort
UNION ALL SELECT '报销单状态' AS dict_name, 'oa_reimburse_status' AS dict_code, '0 草稿 / 1 审批中 / 2 已通过 / 3 已驳回 / 4 已撤回 / 5 已打款' AS remark, 630 AS sort
UNION ALL SELECT '薪酬单状态' AS dict_name, 'oa_compensation_status' AS dict_code, '0 草稿 / 1 已确认 / 2 已发放 / 3 已作废' AS remark, 640 AS sort
UNION ALL SELECT '薪酬项类型' AS dict_name, 'oa_compensation_item_type' AS dict_code, '1 增项 / 2 扣项' AS remark, 650 AS sort
UNION ALL SELECT '公告类型' AS dict_name, 'oa_notice_type' AS dict_code, '0 通知 / 1 公告 / 2 活动' AS remark, 660 AS sort
UNION ALL SELECT '公告状态' AS dict_name, 'oa_notice_status' AS dict_code, '0 草稿 / 1 已发布 / 2 已下架' AS remark, 670 AS sort
UNION ALL SELECT 'OA文档状态' AS dict_name, 'oa_doc_status' AS dict_code, '0 草稿 / 1 已发布 / 2 已归档' AS remark, 680 AS sort
UNION ALL SELECT 'OA文档关联类型' AS dict_name, 'oa_doc_relation' AS dict_code, 'reference 引用 / related 相关 / version 版本 / belong 从属' AS remark, 690 AS sort
UNION ALL SELECT 'OA文档可见性' AS dict_name, 'oa_doc_visibility' AS dict_code, '0 租户公开 / 1 私密' AS remark, 700 AS sort
UNION ALL SELECT '登录方式' AS dict_name, 'system_login_type' AS dict_code, '登录日志' AS remark, 710 AS sort
UNION ALL SELECT '请求方法' AS dict_name, 'system_http_method' AS dict_code, '操作日志' AS remark, 720 AS sort
UNION ALL SELECT '菜单类型' AS dict_name, 'system_menu_type' AS dict_code, '1 目录 / 2 菜单 / 3 按钮' AS remark, 730 AS sort
UNION ALL SELECT '订购单状态' AS dict_name, 'common_order_status' AS dict_code, '产品/套餐购买单状态' AS remark, 740 AS sort
UNION ALL SELECT '前台导航类型' AS dict_name, 'cms_front_menu_type' AS dict_code, '1 目录 / 2 页面 / 3 外链 / 4 单页' AS remark, 750 AS sort
UNION ALL SELECT '需求状态' AS dict_name, 'cms_demand_status' AS dict_code, '1 待处理 / 2 处理中 / 3 已完成 / 4 已拒绝' AS remark, 760 AS sort
UNION ALL SELECT '域名核验状态' AS dict_name, 'tenant_domain_verify_status' AS dict_code, '0 未检测 / 1 已通过 / 2 未通过' AS remark, 770 AS sort
UNION ALL SELECT '域名证书状态' AS dict_name, 'tenant_domain_ssl_status' AS dict_code, '0 待处理 / 1 签发中 / 2 已签发 / 3 签发失败' AS remark, 780 AS sort
) AS t
WHERE NOT EXISTS (
SELECT 1 FROM `yz_backend_dict` AS d
WHERE d.tenant_id = '0' AND d.dict_code = t.dict_code AND d.delete_time IS NULL
);
-- =============================================================
-- 2. 字典项(全局内置)
-- =============================================================
INSERT INTO `yz_backend_dict_item` (`tenant_id`, `dict_id`, `item_label`, `item_value`, `tag_type`, `sort`, `status`, `is_default`, `create_time`)
SELECT '0', d.id, t.item_label, t.item_value, t.tag_type, t.sort, 1, 0, NOW()
FROM (
SELECT 'common_status' AS dict_code, '正常' AS item_label, '1' AS item_value, 'success' AS tag_type, 10 AS sort
UNION ALL SELECT 'common_status' AS dict_code, '禁用' AS item_label, '0' AS item_value, 'info' AS tag_type, 20 AS sort
UNION ALL SELECT 'common_status' AS dict_code, '冻结' AS item_label, '2' AS item_value, 'warning' AS tag_type, 30 AS sort
UNION ALL SELECT 'common_status' AS dict_code, '已注销' AS item_label, '3' AS item_value, 'danger' AS tag_type, 40 AS sort
UNION ALL SELECT 'common_object_level' AS dict_code, '核心' AS item_label, '1' AS item_value, 'danger' AS tag_type, 10 AS sort
UNION ALL SELECT 'common_object_level' AS dict_code, '重要' AS item_label, '2' AS item_value, 'warning' AS tag_type, 20 AS sort
UNION ALL SELECT 'common_object_level' AS dict_code, '普通' AS item_label, '3' AS item_value, 'info' AS tag_type, 30 AS sort
UNION ALL SELECT 'common_object_level' AS dict_code, '潜在' AS item_label, '4' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'common_gender' AS dict_code, '未知' AS item_label, '0' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'common_gender' AS dict_code, '男' AS item_label, '1' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'common_gender' AS dict_code, '女' AS item_label, '2' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'common_enable_status' AS dict_code, '禁用' AS item_label, '0' AS item_value, 'info' AS tag_type, 10 AS sort
UNION ALL SELECT 'common_enable_status' AS dict_code, '启用' AS item_label, '1' AS item_value, 'success' AS tag_type, 20 AS sort
UNION ALL SELECT 'common_todo_status' AS dict_code, '待办' AS item_label, '0' AS item_value, 'info' AS tag_type, 10 AS sort
UNION ALL SELECT 'common_todo_status' AS dict_code, '已完成' AS item_label, '1' AS item_value, 'success' AS tag_type, 20 AS sort
UNION ALL SELECT 'common_priority' AS dict_code, '重要' AS item_label, '1' AS item_value, 'warning' AS tag_type, 10 AS sort
UNION ALL SELECT 'common_priority' AS dict_code, '紧急' AS item_label, '2' AS item_value, 'danger' AS tag_type, 20 AS sort
UNION ALL SELECT 'common_contact_type' AS dict_code, '企业' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'common_contact_type' AS dict_code, '个人' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'common_notify_channel' AS dict_code, '短信' AS item_label, 'SMS' AS item_value, 'success' AS tag_type, 10 AS sort
UNION ALL SELECT 'common_notify_channel' AS dict_code, '邮件' AS item_label, 'EMAIL' AS item_value, 'warning' AS tag_type, 20 AS sort
UNION ALL SELECT 'common_notify_channel' AS dict_code, 'Bark推送' AS item_label, 'BARK' AS item_value, 'danger' AS tag_type, 30 AS sort
UNION ALL SELECT 'common_notify_channel' AS dict_code, '站内信' AS item_label, 'SITE_MSG' AS item_value, 'primary' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_pool_reason' AS dict_code, '长期未跟进' AS item_label, '长期未跟进' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_pool_reason' AS dict_code, '合作终止' AS item_label, '合作终止' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_pool_reason' AS dict_code, '重复建档' AS item_label, '重复建档' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_pool_reason' AS dict_code, '负责人离职' AS item_label, '负责人离职' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_pool_reason' AS dict_code, '手动释放' AS item_label, '手动释放' AS item_value, '' AS tag_type, 50 AS sort
UNION ALL SELECT 'crm_pool_reason' AS dict_code, '其他' AS item_label, '其他' AS item_value, '' AS tag_type, 60 AS sort
UNION ALL SELECT 'erp_related_type' AS dict_code, '客户' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'erp_related_type' AS dict_code, '供应商' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'erp_customer_type' AS dict_code, '企业' AS item_label, '1' AS item_value, 'primary' AS tag_type, 10 AS sort
UNION ALL SELECT 'erp_customer_type' AS dict_code, '政府机构' AS item_label, '2' AS item_value, 'warning' AS tag_type, 20 AS sort
UNION ALL SELECT 'erp_customer_type' AS dict_code, '国企' AS item_label, '3' AS item_value, 'success' AS tag_type, 30 AS sort
UNION ALL SELECT 'erp_customer_type' AS dict_code, '教育机构' AS item_label, '4' AS item_value, 'info' AS tag_type, 40 AS sort
UNION ALL SELECT 'erp_customer_type' AS dict_code, '个人' AS item_label, '5' AS item_value, 'info' AS tag_type, 50 AS sort
UNION ALL SELECT 'erp_supplier_type' AS dict_code, '原材料供应商' AS item_label, '1' AS item_value, 'primary' AS tag_type, 10 AS sort
UNION ALL SELECT 'erp_supplier_type' AS dict_code, '设备供应商' AS item_label, '2' AS item_value, 'warning' AS tag_type, 20 AS sort
UNION ALL SELECT 'erp_supplier_type' AS dict_code, '服务供应商' AS item_label, '3' AS item_value, 'success' AS tag_type, 30 AS sort
UNION ALL SELECT 'erp_supplier_type' AS dict_code, '其他' AS item_label, '4' AS item_value, 'info' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_clue_source' AS dict_code, '官网咨询' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_clue_source' AS dict_code, '电话咨询' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_clue_source' AS dict_code, '朋友介绍' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_clue_source' AS dict_code, '展会活动' AS item_label, '4' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_clue_source' AS dict_code, '广告投放' AS item_label, '5' AS item_value, '' AS tag_type, 50 AS sort
UNION ALL SELECT 'crm_clue_source' AS dict_code, '陌生拜访' AS item_label, '6' AS item_value, '' AS tag_type, 60 AS sort
UNION ALL SELECT 'crm_clue_source' AS dict_code, '其他' AS item_label, '7' AS item_value, '' AS tag_type, 70 AS sort
UNION ALL SELECT 'crm_clue_status' AS dict_code, '跟进中' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_clue_status' AS dict_code, '已转化' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_clue_status' AS dict_code, '已废弃' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_clue_level' AS dict_code, '重点' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_clue_level' AS dict_code, '普通' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_clue_level' AS dict_code, '非优先' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_business_stage' AS dict_code, '初步接洽' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_business_stage' AS dict_code, '需求确认' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_business_stage' AS dict_code, '方案报价' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_business_stage' AS dict_code, '商务谈判' AS item_label, '4' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_business_stage' AS dict_code, '赢单' AS item_label, '5' AS item_value, '' AS tag_type, 50 AS sort
UNION ALL SELECT 'crm_business_stage' AS dict_code, '输单' AS item_label, '6' AS item_value, '' AS tag_type, 60 AS sort
UNION ALL SELECT 'crm_business_status' AS dict_code, '跟进中' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_business_status' AS dict_code, '已转化项目' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_business_status' AS dict_code, '已关闭' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_follow_type' AS dict_code, '电话' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_follow_type' AS dict_code, '微信' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_follow_type' AS dict_code, '上门' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_follow_type' AS dict_code, '邮件' AS item_label, '4' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_follow_type' AS dict_code, '其他' AS item_label, '5' AS item_value, '' AS tag_type, 50 AS sort
UNION ALL SELECT 'crm_pipeline_related_type' AS dict_code, '线索' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_pipeline_related_type' AS dict_code, '商机' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_pipeline_related_type' AS dict_code, '项目' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_project_status' AS dict_code, '未开始' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_project_status' AS dict_code, '进行中' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_project_status' AS dict_code, '已完成' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_project_status' AS dict_code, '已暂停' AS item_label, '4' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_project_status' AS dict_code, '异常' AS item_label, '5' AS item_value, '' AS tag_type, 50 AS sort
UNION ALL SELECT 'crm_project_type' AS dict_code, '单一项目' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_project_type' AS dict_code, '上下游项目' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_project_type' AS dict_code, '上中游项目' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_contract_category' AS dict_code, '开发合同' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_contract_category' AS dict_code, '服务合同' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_contract_category' AS dict_code, '销售合同' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_contract_category' AS dict_code, '租赁合同' AS item_label, '4' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_contract_category' AS dict_code, '采购合同' AS item_label, '5' AS item_value, '' AS tag_type, 50 AS sort
UNION ALL SELECT 'crm_contract_category' AS dict_code, '运维合同' AS item_label, '6' AS item_value, '' AS tag_type, 60 AS sort
UNION ALL SELECT 'crm_contract_category' AS dict_code, '咨询合同' AS item_label, '7' AS item_value, '' AS tag_type, 70 AS sort
UNION ALL SELECT 'crm_contract_category' AS dict_code, '其他' AS item_label, '8' AS item_value, '' AS tag_type, 80 AS sort
UNION ALL SELECT 'crm_contract_status' AS dict_code, '草稿' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_contract_status' AS dict_code, '已完成' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_contract_status' AS dict_code, '履约中' AS item_label, '4' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_contract_status' AS dict_code, '异常' AS item_label, '5' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_contract_status' AS dict_code, '已作废' AS item_label, '3' AS item_value, '' AS tag_type, 50 AS sort
UNION ALL SELECT 'crm_contract_party_count' AS dict_code, '双方合同' AS item_label, '2' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_contract_party_count' AS dict_code, '三方合同' AS item_label, '3' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_contract_party_count' AS dict_code, '四方合同' AS item_label, '4' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_contract_our_role' AS dict_code, '甲方' AS item_label, '1' AS item_value, 'danger' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_contract_our_role' AS dict_code, '乙方' AS item_label, '2' AS item_value, 'primary' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_contract_our_role' AS dict_code, '丙方' AS item_label, '3' AS item_value, 'warning' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_contract_our_role' AS dict_code, '丁方' AS item_label, '4' AS item_value, 'success' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_contract_product_category' AS dict_code, '硬件(货物)' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_contract_product_category' AS dict_code, '软件(许可)' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_contract_product_category' AS dict_code, '服务' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_contract_product_category' AS dict_code, '开发' AS item_label, '4' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_contract_product_category' AS dict_code, '其他' AS item_label, '5' AS item_value, '' AS tag_type, 50 AS sort
UNION ALL SELECT 'crm_payback_cycle' AS dict_code, '月度' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_payback_cycle' AS dict_code, '季度' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_payback_cycle' AS dict_code, '年度' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_payback_cycle' AS dict_code, '进度' AS item_label, '4' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_payback_cycle' AS dict_code, '自定义' AS item_label, '5' AS item_value, '' AS tag_type, 50 AS sort
UNION ALL SELECT 'crm_payback_method' AS dict_code, '对公转账' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_payback_method' AS dict_code, '网银转账' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_payback_method' AS dict_code, '现金' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_payback_method' AS dict_code, '支票' AS item_label, '4' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_payback_method' AS dict_code, '支付宝' AS item_label, '5' AS item_value, '' AS tag_type, 50 AS sort
UNION ALL SELECT 'crm_payback_method' AS dict_code, '微信' AS item_label, '6' AS item_value, '' AS tag_type, 60 AS sort
UNION ALL SELECT 'crm_payback_method' AS dict_code, '其他' AS item_label, '7' AS item_value, '' AS tag_type, 70 AS sort
UNION ALL SELECT 'crm_payback_status' AS dict_code, '进行中' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_payback_status' AS dict_code, '已完成' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_payback_item_status' AS dict_code, '未回款' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_payback_item_status' AS dict_code, '部分回款' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_payback_item_status' AS dict_code, '已回款' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_product_status' AS dict_code, '启用' AS item_label, '1' AS item_value, 'success' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_product_status' AS dict_code, '停用' AS item_label, '0' AS item_value, 'info' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_product_unit' AS dict_code, '套' AS item_label, '套' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_product_unit' AS dict_code, '台' AS item_label, '台' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_product_unit' AS dict_code, '个' AS item_label, '个' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_product_unit' AS dict_code, '件' AS item_label, '件' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_product_unit' AS dict_code, '批' AS item_label, '批' AS item_value, '' AS tag_type, 50 AS sort
UNION ALL SELECT 'crm_product_unit' AS dict_code, '次' AS item_label, '次' AS item_value, '' AS tag_type, 60 AS sort
UNION ALL SELECT 'crm_product_unit' AS dict_code, '人月' AS item_label, '人月' AS item_value, '' AS tag_type, 70 AS sort
UNION ALL SELECT 'crm_product_unit' AS dict_code, '人天' AS item_label, '人天' AS item_value, '' AS tag_type, 80 AS sort
UNION ALL SELECT 'crm_product_unit' AS dict_code, '年' AS item_label, '年' AS item_value, '' AS tag_type, 90 AS sort
UNION ALL SELECT 'crm_product_dev_mode' AS dict_code, '自行研发' AS item_label, 'self' AS item_value, 'success' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_product_dev_mode' AS dict_code, '外协研发' AS item_label, 'outsource' AS item_value, 'warning' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_tender_status' AS dict_code, '草稿' AS item_label, '0' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_tender_status' AS dict_code, '公告中' AS item_label, '1' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_tender_status' AS dict_code, '报名中' AS item_label, '2' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_tender_status' AS dict_code, '投标中' AS item_label, '3' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_tender_status' AS dict_code, '开标中' AS item_label, '4' AS item_value, '' AS tag_type, 50 AS sort
UNION ALL SELECT 'crm_tender_status' AS dict_code, '评标中' AS item_label, '5' AS item_value, '' AS tag_type, 60 AS sort
UNION ALL SELECT 'crm_tender_status' AS dict_code, '已定标' AS item_label, '6' AS item_value, '' AS tag_type, 70 AS sort
UNION ALL SELECT 'crm_tender_status' AS dict_code, '已归档' AS item_label, '7' AS item_value, '' AS tag_type, 80 AS sort
UNION ALL SELECT 'crm_tender_type' AS dict_code, '公开招标' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_tender_type' AS dict_code, '邀请招标' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_tender_type' AS dict_code, '竞争性谈判' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_tender_type' AS dict_code, '询比采购' AS item_label, '4' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_tender_type' AS dict_code, '单一来源' AS item_label, '5' AS item_value, '' AS tag_type, 50 AS sort
UNION ALL SELECT 'crm_tender_result_type' AS dict_code, '定标' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_tender_result_type' AS dict_code, '流标' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_tender_result_type' AS dict_code, '废标' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_tender_supplier_status' AS dict_code, '待审核' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_tender_supplier_status' AS dict_code, '已通过' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_tender_supplier_status' AS dict_code, '已拒绝' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_tender_supplier_status' AS dict_code, '已退标' AS item_label, '4' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_tender_announce_type' AS dict_code, '招标公告' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_tender_announce_type' AS dict_code, '变更公告' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_tender_announce_type' AS dict_code, '中标公告' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_tender_announce_type' AS dict_code, '终止公告' AS item_label, '4' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_evaluation_method' AS dict_code, '综合评估法' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_evaluation_method' AS dict_code, '最低价法' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_evaluation_method' AS dict_code, '性价比法' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_evaluation_result' AS dict_code, '待评' AS item_label, '0' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_evaluation_result' AS dict_code, '合格' AS item_label, '1' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_evaluation_result' AS dict_code, '不合格' AS item_label, '2' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_evaluation_result' AS dict_code, '废标' AS item_label, '3' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_bid_status' AS dict_code, '草稿' AS item_label, '0' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_bid_status' AS dict_code, '立项审批中' AS item_label, '1' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_bid_status' AS dict_code, '投标中' AS item_label, '2' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_bid_status' AS dict_code, '已开标' AS item_label, '3' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_bid_status' AS dict_code, '中标' AS item_label, '4' AS item_value, '' AS tag_type, 50 AS sort
UNION ALL SELECT 'crm_bid_status' AS dict_code, '落标' AS item_label, '5' AS item_value, '' AS tag_type, 60 AS sort
UNION ALL SELECT 'crm_bid_status' AS dict_code, '已转合同' AS item_label, '6' AS item_value, '' AS tag_type, 70 AS sort
UNION ALL SELECT 'crm_bid_status' AS dict_code, '已归档' AS item_label, '7' AS item_value, '' AS tag_type, 80 AS sort
UNION ALL SELECT 'crm_bid_type' AS dict_code, '公开招标' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_bid_type' AS dict_code, '邀请招标' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_bid_type' AS dict_code, '竞争性谈判' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_bid_type' AS dict_code, '询比采购' AS item_label, '4' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_bid_type' AS dict_code, '单一来源' AS item_label, '5' AS item_value, '' AS tag_type, 50 AS sort
UNION ALL SELECT 'crm_bid_source_type' AS dict_code, '独立创建' AS item_label, '0' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_bid_source_type' AS dict_code, '商机' AS item_label, '1' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_bid_source_type' AS dict_code, '项目' AS item_label, '2' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_bid_result_type' AS dict_code, '中标' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_bid_result_type' AS dict_code, '未中标' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_bid_result_type' AS dict_code, '废标' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_bid_result_type' AS dict_code, '流标' AS item_label, '4' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_bid_task_type' AS dict_code, '商务' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_bid_task_type' AS dict_code, '技术' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_bid_task_type' AS dict_code, '报价' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_bid_task_type' AS dict_code, '法务' AS item_label, '4' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_bid_task_type' AS dict_code, '财务' AS item_label, '5' AS item_value, '' AS tag_type, 50 AS sort
UNION ALL SELECT 'crm_bid_task_type' AS dict_code, '其他' AS item_label, '6' AS item_value, '' AS tag_type, 60 AS sort
UNION ALL SELECT 'crm_bid_task_status' AS dict_code, '未开始' AS item_label, '0' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_bid_task_status' AS dict_code, '进行中' AS item_label, '1' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_bid_task_status' AS dict_code, '已完成' AS item_label, '2' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_bid_task_status' AS dict_code, '已逾期' AS item_label, '3' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_bid_task_status' AS dict_code, '已取消' AS item_label, '4' AS item_value, '' AS tag_type, 50 AS sort
UNION ALL SELECT 'crm_bid_template_type' AS dict_code, '技术标' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_bid_template_type' AS dict_code, '商务标' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_bid_template_type' AS dict_code, '综合标' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_bid_quote_status' AS dict_code, '草稿' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_bid_quote_status' AS dict_code, '待审批' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_bid_quote_status' AS dict_code, '已审批' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_bid_quote_status' AS dict_code, '已使用' AS item_label, '4' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_bid_document_status' AS dict_code, '编辑中' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_bid_document_status' AS dict_code, '待审核' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_bid_document_status' AS dict_code, '已定稿' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_bid_document_status' AS dict_code, '已提交' AS item_label, '4' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_bid_expense_type' AS dict_code, '标书费' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_bid_expense_type' AS dict_code, '保证金' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_bid_expense_type' AS dict_code, '差旅费' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_bid_expense_type' AS dict_code, '咨询费' AS item_label, '4' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_bid_expense_type' AS dict_code, '代理费' AS item_label, '5' AS item_value, '' AS tag_type, 50 AS sort
UNION ALL SELECT 'crm_bid_expense_type' AS dict_code, '其他' AS item_label, '6' AS item_value, '' AS tag_type, 60 AS sort
UNION ALL SELECT 'crm_competitor_type' AS dict_code, '同类厂商' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_competitor_type' AS dict_code, '关联企业' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_competitor_type' AS dict_code, '其他' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_qualification_type' AS dict_code, '营业执照' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_qualification_type' AS dict_code, '资质证书' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_qualification_type' AS dict_code, '业绩证明' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_qualification_type' AS dict_code, '认证证书' AS item_label, '4' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_qualification_type' AS dict_code, '其他' AS item_label, '5' AS item_value, '' AS tag_type, 50 AS sort
UNION ALL SELECT 'crm_qualification_status' AS dict_code, '有效' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_qualification_status' AS dict_code, '即将过期' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_qualification_status' AS dict_code, '失效' AS item_label, '0' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_payment_status' AS dict_code, '未付' AS item_label, '0' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_payment_status' AS dict_code, '已付' AS item_label, '1' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_payment_status' AS dict_code, '已退还' AS item_label, '2' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_payment_status' AS dict_code, '已抵扣' AS item_label, '3' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'crm_approval_type' AS dict_code, '立项审批' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_approval_type' AS dict_code, '报价审批' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_approval_type' AS dict_code, '合同审批' AS item_label, '3' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_approval_status' AS dict_code, '待审批' AS item_label, '0' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'crm_approval_status' AS dict_code, '已通过' AS item_label, '1' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'crm_approval_status' AS dict_code, '已拒绝' AS item_label, '2' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'crm_approval_status' AS dict_code, '已撤回' AS item_label, '3' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'erp_account_set_standard' AS dict_code, '企业会计准则' AS item_label, '1' AS item_value, 'primary' AS tag_type, 10 AS sort
UNION ALL SELECT 'erp_account_set_standard' AS dict_code, '小企业会计准则' AS item_label, '2' AS item_value, 'info' AS tag_type, 20 AS sort
UNION ALL SELECT 'erp_account_set_currency' AS dict_code, '人民币' AS item_label, 'CNY' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'erp_account_set_currency' AS dict_code, '美元' AS item_label, 'USD' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'erp_account_set_currency' AS dict_code, '欧元' AS item_label, 'EUR' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'erp_account_set_currency' AS dict_code, '港币' AS item_label, 'HKD' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'erp_position_type' AS dict_code, '普通职位' AS item_label, '0' AS item_value, 'info' AS tag_type, 10 AS sort
UNION ALL SELECT 'erp_position_type' AS dict_code, '主管' AS item_label, '1' AS item_value, 'warning' AS tag_type, 20 AS sort
UNION ALL SELECT 'erp_position_type' AS dict_code, '负责人' AS item_label, '2' AS item_value, 'primary' AS tag_type, 30 AS sort
UNION ALL SELECT 'common_employee_status' AS dict_code, '禁用' AS item_label, '0' AS item_value, 'info' AS tag_type, 10 AS sort
UNION ALL SELECT 'common_employee_status' AS dict_code, '正常' AS item_label, '1' AS item_value, 'success' AS tag_type, 20 AS sort
UNION ALL SELECT 'common_employee_status' AS dict_code, '离职' AS item_label, '2' AS item_value, 'danger' AS tag_type, 30 AS sort
UNION ALL SELECT 'oa_employee_hire_status' AS dict_code, '试用' AS item_label, '1' AS item_value, 'warning' AS tag_type, 10 AS sort
UNION ALL SELECT 'oa_employee_hire_status' AS dict_code, '正式' AS item_label, '2' AS item_value, 'success' AS tag_type, 20 AS sort
UNION ALL SELECT 'oa_employee_hire_status' AS dict_code, '离职' AS item_label, '3' AS item_value, 'danger' AS tag_type, 30 AS sort
UNION ALL SELECT 'oa_employee_marital' AS dict_code, '未知' AS item_label, '0' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'oa_employee_marital' AS dict_code, '未婚' AS item_label, '1' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'oa_employee_marital' AS dict_code, '已婚' AS item_label, '2' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'oa_employee_marital' AS dict_code, '离异' AS item_label, '3' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'oa_employee_marital' AS dict_code, '丧偶' AS item_label, '4' AS item_value, '' AS tag_type, 50 AS sort
UNION ALL SELECT 'oa_reimburse_status' AS dict_code, '草稿' AS item_label, '0' AS item_value, 'info' AS tag_type, 10 AS sort
UNION ALL SELECT 'oa_reimburse_status' AS dict_code, '审批中' AS item_label, '1' AS item_value, 'warning' AS tag_type, 20 AS sort
UNION ALL SELECT 'oa_reimburse_status' AS dict_code, '已通过' AS item_label, '2' AS item_value, 'success' AS tag_type, 30 AS sort
UNION ALL SELECT 'oa_reimburse_status' AS dict_code, '已驳回' AS item_label, '3' AS item_value, 'danger' AS tag_type, 40 AS sort
UNION ALL SELECT 'oa_reimburse_status' AS dict_code, '已撤回' AS item_label, '4' AS item_value, 'info' AS tag_type, 50 AS sort
UNION ALL SELECT 'oa_reimburse_status' AS dict_code, '已打款' AS item_label, '5' AS item_value, 'success' AS tag_type, 60 AS sort
UNION ALL SELECT 'oa_compensation_status' AS dict_code, '草稿' AS item_label, '0' AS item_value, 'info' AS tag_type, 10 AS sort
UNION ALL SELECT 'oa_compensation_status' AS dict_code, '已确认' AS item_label, '1' AS item_value, 'warning' AS tag_type, 20 AS sort
UNION ALL SELECT 'oa_compensation_status' AS dict_code, '已发放' AS item_label, '2' AS item_value, 'success' AS tag_type, 30 AS sort
UNION ALL SELECT 'oa_compensation_status' AS dict_code, '已作废' AS item_label, '3' AS item_value, 'danger' AS tag_type, 40 AS sort
UNION ALL SELECT 'oa_compensation_item_type' AS dict_code, '增项' AS item_label, '1' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'oa_compensation_item_type' AS dict_code, '扣项' AS item_label, '2' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'oa_notice_type' AS dict_code, '通知' AS item_label, '0' AS item_value, 'info' AS tag_type, 10 AS sort
UNION ALL SELECT 'oa_notice_type' AS dict_code, '公告' AS item_label, '1' AS item_value, 'primary' AS tag_type, 20 AS sort
UNION ALL SELECT 'oa_notice_type' AS dict_code, '活动' AS item_label, '2' AS item_value, 'success' AS tag_type, 30 AS sort
UNION ALL SELECT 'oa_notice_status' AS dict_code, '草稿' AS item_label, '0' AS item_value, 'info' AS tag_type, 10 AS sort
UNION ALL SELECT 'oa_notice_status' AS dict_code, '已发布' AS item_label, '1' AS item_value, 'success' AS tag_type, 20 AS sort
UNION ALL SELECT 'oa_notice_status' AS dict_code, '已下架' AS item_label, '2' AS item_value, 'warning' AS tag_type, 30 AS sort
UNION ALL SELECT 'oa_doc_status' AS dict_code, '草稿' AS item_label, '0' AS item_value, 'warning' AS tag_type, 10 AS sort
UNION ALL SELECT 'oa_doc_status' AS dict_code, '已发布' AS item_label, '1' AS item_value, 'success' AS tag_type, 20 AS sort
UNION ALL SELECT 'oa_doc_status' AS dict_code, '已归档' AS item_label, '2' AS item_value, 'info' AS tag_type, 30 AS sort
UNION ALL SELECT 'oa_doc_relation' AS dict_code, '引用' AS item_label, 'reference' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'oa_doc_relation' AS dict_code, '相关' AS item_label, 'related' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'oa_doc_relation' AS dict_code, '版本' AS item_label, 'version' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'oa_doc_relation' AS dict_code, '从属' AS item_label, 'belong' AS item_value, '' AS tag_type, 40 AS sort
UNION ALL SELECT 'oa_doc_visibility' AS dict_code, '租户公开' AS item_label, '0' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'oa_doc_visibility' AS dict_code, '私密' AS item_label, '1' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'system_login_type' AS dict_code, '密码登录' AS item_label, 'password' AS item_value, '' AS tag_type, 10 AS sort
UNION ALL SELECT 'system_login_type' AS dict_code, '短信验证码' AS item_label, 'sms' AS item_value, '' AS tag_type, 20 AS sort
UNION ALL SELECT 'system_login_type' AS dict_code, '邮箱验证码' AS item_label, 'email' AS item_value, '' AS tag_type, 30 AS sort
UNION ALL SELECT 'system_http_method' AS dict_code, 'GET' AS item_label, 'GET' AS item_value, 'info' AS tag_type, 10 AS sort
UNION ALL SELECT 'system_http_method' AS dict_code, 'POST' AS item_label, 'POST' AS item_value, 'success' AS tag_type, 20 AS sort
UNION ALL SELECT 'system_http_method' AS dict_code, 'PUT' AS item_label, 'PUT' AS item_value, 'warning' AS tag_type, 30 AS sort
UNION ALL SELECT 'system_http_method' AS dict_code, 'DELETE' AS item_label, 'DELETE' AS item_value, 'danger' AS tag_type, 40 AS sort
UNION ALL SELECT 'system_http_method' AS dict_code, 'PATCH' AS item_label, 'PATCH' AS item_value, 'primary' AS tag_type, 50 AS sort
UNION ALL SELECT 'system_menu_type' AS dict_code, '目录' AS item_label, '1' AS item_value, 'primary' AS tag_type, 10 AS sort
UNION ALL SELECT 'system_menu_type' AS dict_code, '菜单' AS item_label, '2' AS item_value, 'success' AS tag_type, 20 AS sort
UNION ALL SELECT 'system_menu_type' AS dict_code, '按钮' AS item_label, '3' AS item_value, 'warning' AS tag_type, 30 AS sort
UNION ALL SELECT 'common_order_status' AS dict_code, '待支付' AS item_label, 'pending' AS item_value, 'warning' AS tag_type, 10 AS sort
UNION ALL SELECT 'common_order_status' AS dict_code, '已支付' AS item_label, 'paid' AS item_value, 'primary' AS tag_type, 20 AS sort
UNION ALL SELECT 'common_order_status' AS dict_code, '已开通' AS item_label, 'activated' AS item_value, 'success' AS tag_type, 30 AS sort
UNION ALL SELECT 'common_order_status' AS dict_code, '已关闭' AS item_label, 'closed' AS item_value, 'info' AS tag_type, 40 AS sort
UNION ALL SELECT 'cms_front_menu_type' AS dict_code, '目录' AS item_label, '1' AS item_value, 'primary' AS tag_type, 10 AS sort
UNION ALL SELECT 'cms_front_menu_type' AS dict_code, '页面' AS item_label, '2' AS item_value, 'success' AS tag_type, 20 AS sort
UNION ALL SELECT 'cms_front_menu_type' AS dict_code, '外链' AS item_label, '3' AS item_value, 'info' AS tag_type, 30 AS sort
UNION ALL SELECT 'cms_front_menu_type' AS dict_code, '单页' AS item_label, '4' AS item_value, 'warning' AS tag_type, 40 AS sort
UNION ALL SELECT 'cms_demand_status' AS dict_code, '待处理' AS item_label, '1' AS item_value, 'info' AS tag_type, 10 AS sort
UNION ALL SELECT 'cms_demand_status' AS dict_code, '处理中' AS item_label, '2' AS item_value, 'warning' AS tag_type, 20 AS sort
UNION ALL SELECT 'cms_demand_status' AS dict_code, '已完成' AS item_label, '3' AS item_value, 'success' AS tag_type, 30 AS sort
UNION ALL SELECT 'cms_demand_status' AS dict_code, '已拒绝' AS item_label, '4' AS item_value, 'danger' AS tag_type, 40 AS sort
UNION ALL SELECT 'tenant_domain_verify_status' AS dict_code, '未检测' AS item_label, '0' AS item_value, 'info' AS tag_type, 10 AS sort
UNION ALL SELECT 'tenant_domain_verify_status' AS dict_code, '已通过' AS item_label, '1' AS item_value, 'success' AS tag_type, 20 AS sort
UNION ALL SELECT 'tenant_domain_verify_status' AS dict_code, '未通过' AS item_label, '2' AS item_value, 'danger' AS tag_type, 30 AS sort
UNION ALL SELECT 'tenant_domain_ssl_status' AS dict_code, '待处理' AS item_label, '0' AS item_value, 'info' AS tag_type, 10 AS sort
UNION ALL SELECT 'tenant_domain_ssl_status' AS dict_code, '签发中' AS item_label, '1' AS item_value, 'warning' AS tag_type, 20 AS sort
UNION ALL SELECT 'tenant_domain_ssl_status' AS dict_code, '已签发' AS item_label, '2' AS item_value, 'success' AS tag_type, 30 AS sort
UNION ALL SELECT 'tenant_domain_ssl_status' AS dict_code, '签发失败' AS item_label, '3' AS item_value, 'danger' AS tag_type, 40 AS sort
) AS t
JOIN `yz_backend_dict` AS d
ON d.tenant_id = '0' AND d.dict_code = t.dict_code AND d.delete_time IS NULL
WHERE NOT EXISTS (
SELECT 1 FROM `yz_backend_dict_item` AS i
WHERE i.dict_id = d.id AND i.item_value = t.item_value AND i.delete_time IS NULL
);
-- =============================================================
-- 3. 校验
-- =============================================================
SELECT d.dict_name, d.dict_code, COUNT(i.id) AS item_count
FROM `yz_backend_dict` d
LEFT JOIN `yz_backend_dict_item` i ON i.dict_id = d.id AND i.delete_time IS NULL
WHERE d.tenant_id = '0' AND d.delete_time IS NULL
GROUP BY d.id, d.dict_name, d.dict_code
ORDER BY d.sort, d.id;