-- ===================================================================
-- mock_ak_contents.sql
-- 模拟 business_item 类型的内容数据
-- 基于统一的 ak_contents 表结构，支持多语言
-- ===================================================================

-- 确保必要的扩展和依赖项
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";

-- 首先确保 ak_contents 表中有 content_type 字段
DO $$
BEGIN
    IF NOT EXISTS (
        SELECT 1 FROM information_schema.columns 
        WHERE table_name = 'ak_contents' 
        AND column_name = 'content_type'
    ) THEN
        ALTER TABLE public.ak_contents 
        ADD COLUMN content_type VARCHAR(50) DEFAULT 'article';
        
        CREATE INDEX IF NOT EXISTS idx_ak_contents_content_type ON public.ak_contents(content_type);
        
        RAISE NOTICE '已为 ak_contents 表添加 content_type 字段';
    END IF;
END
$$;

-- 确保业务分类存在
INSERT INTO public.ak_content_categories (name_key, parent_id, level, ai_keywords, sort_order, is_active) VALUES
('business.ai', NULL, 0, ARRAY['人工智能', 'AI', '机器学习', 'artificial intelligence', 'machine learning'], 1, true),
('business.bigdata', NULL, 0, ARRAY['大数据', 'big data', '数据分析', 'analytics', 'data science'], 2, true),
('business.iot', NULL, 0, ARRAY['物联网', 'IoT', '智能设备', 'smart devices', 'internet of things'], 3, true),
('business.cloud', NULL, 0, ARRAY['云计算', 'cloud computing', '云服务', 'cloud services', 'AWS', 'Azure'], 4, true),
('business.blockchain', NULL, 0, ARRAY['区块链', 'blockchain', '数字货币', 'cryptocurrency', 'DeFi'], 5, true),
('business.mobile', NULL, 0, ARRAY['移动开发', 'mobile development', 'APP开发', 'mobile app', 'iOS', 'Android'], 6, true),
('business.web', NULL, 0, ARRAY['前端开发', 'web development', '网站建设', 'website', 'React', 'Vue'], 7, true),
('business.database', NULL, 0, ARRAY['数据库', 'database', 'SQL', '数据管理', 'PostgreSQL', 'MySQL'], 8, true),
('business.cybersecurity', NULL, 0, ARRAY['网络安全', 'cybersecurity', '信息安全', 'security', '防护'], 9, true),
('business.fintech', NULL, 0, ARRAY['金融科技', 'fintech', '数字支付', 'payment', '金融创新'], 10, true)
ON CONFLICT (name_key) DO NOTHING;

-- 获取分类ID的变量声明
DO $$
DECLARE
    ai_category_id UUID;
    bigdata_category_id UUID;
    iot_category_id UUID;
    cloud_category_id UUID;
    blockchain_category_id UUID;
    mobile_category_id UUID;
    web_category_id UUID;
    database_category_id UUID;
    cybersecurity_category_id UUID;
    fintech_category_id UUID;
    base_date TIMESTAMP WITH TIME ZONE;
BEGIN
    -- 获取分类ID
    SELECT id INTO ai_category_id FROM public.ak_content_categories WHERE name_key = 'business.ai';
    SELECT id INTO bigdata_category_id FROM public.ak_content_categories WHERE name_key = 'business.bigdata';
    SELECT id INTO iot_category_id FROM public.ak_content_categories WHERE name_key = 'business.iot';
    SELECT id INTO cloud_category_id FROM public.ak_content_categories WHERE name_key = 'business.cloud';
    SELECT id INTO blockchain_category_id FROM public.ak_content_categories WHERE name_key = 'business.blockchain';
    SELECT id INTO mobile_category_id FROM public.ak_content_categories WHERE name_key = 'business.mobile';
    SELECT id INTO web_category_id FROM public.ak_content_categories WHERE name_key = 'business.web';
    SELECT id INTO database_category_id FROM public.ak_content_categories WHERE name_key = 'business.database';
    SELECT id INTO cybersecurity_category_id FROM public.ak_content_categories WHERE name_key = 'business.cybersecurity';
    SELECT id INTO fintech_category_id FROM public.ak_content_categories WHERE name_key = 'business.fintech';
    
    -- 设置基准日期
    base_date := NOW() - INTERVAL '30 days';

    -- ===================================================================
    -- 插入中文业务项目数据
    -- ===================================================================
    
    INSERT INTO public.ak_contents (
        title, 
        content_summary, 
        content_type, 
        category_id, 
        original_language, 
        status, 
        featured_image_url,
        view_count,
        published_at,
        tags,
        quality_score,
        ai_processed,
        seo_title,
        seo_description,
        reading_time_minutes
    ) VALUES
    -- AI相关业务
    (
        '智能客服系统解决方案',
        '基于自然语言处理和机器学习技术，为企业提供7×24小时智能客服服务。支持多轮对话、情感识别、知识图谱等先进功能，大幅提升客户服务效率和满意度。',
        'business_item',
        ai_category_id,
        'zh-CN',
        'published',
        'https://picsum.photos/800/600?random=1',
        2156,
        base_date + INTERVAL '1 day',
        ARRAY['人工智能', '客服系统', 'NLP', '机器学习', '智能对话'],
        0.95,
        true,
        '智能客服系统 - AI驱动的客户服务解决方案',
        '专业的AI智能客服系统，提供自然语言处理、情感识别等功能，提升客户服务质量',
        8
    ),
    (
        '计算机视觉图像识别平台',
        '采用深度学习算法，提供人脸识别、物体检测、图像分类、OCR文字识别等服务。广泛应用于安防监控、智能制造、零售等行业。',
        'business_item',
        ai_category_id,
        'zh-CN',
        'published',
        'https://picsum.photos/800/600?random=2',
        1834,
        base_date + INTERVAL '3 day',
        ARRAY['计算机视觉', '图像识别', '深度学习', '人脸识别', 'OCR'],
        0.92,
        true,
        '计算机视觉平台 - 智能图像识别解决方案',
        '基于深度学习的图像识别平台，支持人脸识别、物体检测、OCR等多种视觉AI服务',
        6
    ),
    
    -- 大数据相关业务
    (
        '企业级数据仓库建设',
        '构建现代化数据仓库架构，整合企业多源异构数据，提供实时数据处理、离线计算、数据湖等综合解决方案。支持PB级数据存储和处理。',
        'business_item',
        bigdata_category_id,
        'zh-CN',
        'published',
        'https://picsum.photos/800/600?random=3',
        1567,
        base_date + INTERVAL '5 day',
        ARRAY['数据仓库', '大数据', '数据湖', '实时计算', 'ETL'],
        0.90,
        true,
        '企业数据仓库 - 现代化大数据架构解决方案',
        '专业的企业级数据仓库建设服务，支持多源数据整合、实时处理、PB级存储',
        12
    ),
    (
        '商业智能BI可视化平台',
        '提供拖拽式报表设计器、多维度数据分析、实时仪表板等功能。帮助企业快速构建数据驱动的决策支持系统，洞察业务价值。',
        'business_item',
        bigdata_category_id,
        'zh-CN',
        'published',
        'https://picsum.photos/800/600?random=4',
        1289,
        base_date + INTERVAL '7 day',
        ARRAY['商业智能', 'BI', '数据可视化', '报表', '数据分析'],
        0.88,
        true,
        'BI商业智能平台 - 数据可视化分析工具',
        '专业的BI商业智能平台，提供可视化报表、数据分析、决策支持等功能',
        10
    ),
    
    -- 物联网相关业务
    (
        '工业物联网监控系统',
        '面向工业4.0的物联网解决方案，集成传感器数据采集、设备远程监控、预测性维护等功能。提高生产效率，降低运营成本。',
        'business_item',
        iot_category_id,
        'zh-CN',
        'published',
        'https://picsum.photos/800/600?random=5',
        1456,
        base_date + INTERVAL '9 day',
        ARRAY['工业物联网', 'IIoT', '设备监控', '预测维护', '工业4.0'],
        0.91,
        true,
        '工业物联网系统 - 智能制造监控解决方案',
        '专业的工业物联网系统，提供设备监控、数据采集、预测维护等智能制造服务',
        9
    ),
    (
        '智能家居控制系统',
        '打造全屋智能生态，支持灯光、空调、安防、家电等设备的统一控制。通过AI学习用户习惯，提供个性化的智能家居体验。',
        'business_item',
        iot_category_id,
        'zh-CN',
        'published',
        'https://picsum.photos/800/600?random=6',
        1123,
        base_date + INTERVAL '11 day',
        ARRAY['智能家居', '物联网', '智能控制', 'AI学习', '家庭自动化'],
        0.87,
        true,
        '智能家居系统 - 全屋智能控制解决方案',
        '专业的智能家居控制系统，支持全屋设备联动、AI学习、个性化服务',
        7
    ),
    
    -- 云计算相关业务
    (
        '企业混合云架构设计',
        '结合公有云和私有云优势，为企业设计最优的混合云架构。提供弹性扩展、成本优化、安全合规的云计算解决方案。',
        'business_item',
        cloud_category_id,
        'zh-CN',
        'published',
        'https://picsum.photos/800/600?random=7',
        1678,
        base_date + INTERVAL '13 day',
        ARRAY['混合云', '云架构', '云计算', '弹性扩展', '成本优化'],
        0.93,
        true,
        '混合云架构 - 企业级云计算解决方案',
        '专业的混合云架构设计服务，提供弹性、安全、经济的企业云计算方案',
        11
    ),
    (
        '容器化DevOps平台',
        '基于Kubernetes的容器编排平台，实现应用的快速部署、自动扩缩容、故障自愈。提供完整的CI/CD流水线和监控告警体系。',
        'business_item',
        cloud_category_id,
        'zh-CN',
        'published',
        'https://picsum.photos/800/600?random=8',
        1345,
        base_date + INTERVAL '15 day',
        ARRAY['DevOps', 'Kubernetes', '容器化', 'CI/CD', '自动部署'],
        0.89,
        true,
        'DevOps容器平台 - 云原生应用部署解决方案',
        '基于Kubernetes的DevOps平台，提供容器编排、CI/CD、自动化运维服务',
        13
    ),
    
    -- 区块链相关业务
    (
        '供应链溯源区块链平台',
        '基于区块链技术的供应链透明化解决方案，实现商品从生产到消费全链条追溯。保障食品安全，提升品牌信任度。',
        'business_item',
        blockchain_category_id,
        'zh-CN',
        'published',
        'https://picsum.photos/800/600?random=9',
        987,
        base_date + INTERVAL '17 day',
        ARRAY['区块链', '供应链', '商品溯源', '食品安全', '透明化'],
        0.86,
        true,
        '区块链溯源 - 供应链透明化解决方案',
        '基于区块链的供应链溯源平台，实现商品全链条追溯，保障安全透明',
        8
    ),
    
    -- 移动开发相关业务
    (
        '跨平台移动应用开发',
        '采用React Native、Flutter等跨平台技术，为企业快速构建iOS和Android双端应用。一套代码，多端运行，大幅降低开发成本。',
        'business_item',
        mobile_category_id,
        'zh-CN',
        'published',
        'https://picsum.photos/800/600?random=10',
        1234,
        base_date + INTERVAL '19 day',
        ARRAY['移动开发', '跨平台', 'React Native', 'Flutter', 'APP开发'],
        0.90,
        true,
        '跨平台APP开发 - 移动应用解决方案',
        '专业的跨平台移动应用开发服务，支持iOS/Android双端，快速高效',
        9
    ),
    
    -- Web开发相关业务
    (
        '企业级Web应用开发',
        '基于现代前端框架（React、Vue、Angular）构建高性能Web应用。提供响应式设计、PWA技术、微前端架构等先进解决方案。',
        'business_item',
        web_category_id,
        'zh-CN',
        'published',
        'https://picsum.photos/800/600?random=11',
        1445,
        base_date + INTERVAL '21 day',
        ARRAY['Web开发', '前端框架', 'React', 'Vue', '响应式设计'],
        0.91,
        true,
        '企业Web应用 - 现代前端开发解决方案',
        '专业的企业级Web应用开发，基于现代前端技术，高性能响应式设计',
        10
    ),
    
    -- 数据库相关业务
    (
        '数据库性能优化服务',
        '提供MySQL、PostgreSQL、Oracle等数据库的深度优化服务。包括SQL调优、索引设计、架构重构、读写分离等专业方案。',
        'business_item',
        database_category_id,
        'zh-CN',
        'published',
        'https://picsum.photos/800/600?random=12',
        1156,
        base_date + INTERVAL '23 day',
        ARRAY['数据库优化', 'SQL调优', '性能提升', '架构设计', '读写分离'],
        0.88,
        true,
        '数据库优化 - 高性能数据库解决方案',
        '专业的数据库性能优化服务，提供SQL调优、架构设计、性能提升方案',
        14
    ),
    
    -- 网络安全相关业务
    (
        '企业网络安全防护体系',
        '构建多层次网络安全防护体系，包括防火墙、入侵检测、漏洞扫描、安全审计等。保护企业数字资产，确保业务安全运行。',
        'business_item',
        cybersecurity_category_id,
        'zh-CN',
        'published',
        'https://picsum.photos/800/600?random=13',
        1367,
        base_date + INTERVAL '25 day',
        ARRAY['网络安全', '安全防护', '防火墙', '入侵检测', '安全审计'],
        0.92,
        true,
        '网络安全防护 - 企业信息安全解决方案',
        '专业的企业网络安全服务，提供多层次防护体系，保障数字资产安全',
        12
    ),
    
    -- 金融科技相关业务
    (
        '数字支付解决方案',
        '提供安全、便捷的数字支付技术解决方案。支持多种支付方式、风控系统、清结算服务，助力金融机构数字化转型。',
        'business_item',
        fintech_category_id,
        'zh-CN',
        'published',
        'https://picsum.photos/800/600?random=14',
        1489,
        base_date + INTERVAL '27 day',
        ARRAY['数字支付', '金融科技', '风控系统', '清结算', '支付安全'],
        0.90,
        true,
        '数字支付平台 - 金融科技解决方案',
        '专业的数字支付解决方案，提供安全风控、清结算、多渠道支付服务',
        11
    );

    -- ===================================================================
    -- 插入英文业务项目数据
    -- ===================================================================
    
    INSERT INTO public.ak_contents (
        title, 
        content_summary, 
        content_type, 
        category_id, 
        original_language, 
        status, 
        featured_image_url,
        view_count,
        published_at,
        tags,
        quality_score,
        ai_processed,
        seo_title,
        seo_description,
        reading_time_minutes
    ) VALUES
    -- AI Business Solutions (English)
    (
        'Intelligent Customer Service System',
        'AI-powered 24/7 customer service solution based on natural language processing and machine learning. Features multi-turn conversations, sentiment analysis, and knowledge graphs to significantly improve service efficiency and customer satisfaction.',
        'business_item',
        ai_category_id,
        'en',
        'published',
        'https://picsum.photos/800/600?random=15',
        1856,
        base_date + INTERVAL '2 day',
        ARRAY['Artificial Intelligence', 'Customer Service', 'NLP', 'Machine Learning', 'Chatbot'],
        0.95,
        true,
        'AI Customer Service - Intelligent Support Solutions',
        'Professional AI customer service system with NLP, sentiment analysis for enhanced customer experience',
        8
    ),
    (
        'Computer Vision Recognition Platform',
        'Deep learning-powered platform offering face recognition, object detection, image classification, and OCR services. Widely applied in security monitoring, smart manufacturing, and retail industries.',
        'business_item',
        ai_category_id,
        'en',
        'published',
        'https://picsum.photos/800/600?random=16',
        1634,
        base_date + INTERVAL '4 day',
        ARRAY['Computer Vision', 'Image Recognition', 'Deep Learning', 'Face Recognition', 'OCR'],
        0.92,
        true,
        'Computer Vision Platform - AI Image Recognition Solutions',
        'Advanced computer vision platform with face recognition, object detection, OCR capabilities',
        6
    ),
    
    -- Big Data Solutions (English)
    (
        'Enterprise Data Warehouse Construction',
        'Modern data warehouse architecture integrating multi-source heterogeneous enterprise data. Provides real-time processing, offline computing, and data lake solutions with PB-scale storage and processing capabilities.',
        'business_item',
        bigdata_category_id,
        'en',
        'published',
        'https://picsum.photos/800/600?random=17',
        1467,
        base_date + INTERVAL '6 day',
        ARRAY['Data Warehouse', 'Big Data', 'Data Lake', 'Real-time Computing', 'ETL'],
        0.90,
        true,
        'Enterprise Data Warehouse - Modern Big Data Architecture',
        'Professional enterprise data warehouse solutions with multi-source integration, real-time processing',
        12
    ),
    
    -- IoT Solutions (English)
    (
        'Industrial IoT Monitoring System',
        'Industry 4.0 IoT solution integrating sensor data collection, remote equipment monitoring, and predictive maintenance. Improves production efficiency while reducing operational costs.',
        'business_item',
        iot_category_id,
        'en',
        'published',
        'https://picsum.photos/800/600?random=18',
        1356,
        base_date + INTERVAL '10 day',
        ARRAY['Industrial IoT', 'IIoT', 'Equipment Monitoring', 'Predictive Maintenance', 'Industry 4.0'],
        0.91,
        true,
        'Industrial IoT System - Smart Manufacturing Solutions',
        'Professional industrial IoT monitoring with predictive maintenance and smart manufacturing features',
        9
    ),
    
    -- Cloud Computing Solutions (English)
    (
        'Enterprise Hybrid Cloud Architecture',
        'Optimal hybrid cloud architecture combining public and private cloud advantages. Provides elastic scaling, cost optimization, and security-compliant cloud computing solutions.',
        'business_item',
        cloud_category_id,
        'en',
        'published',
        'https://picsum.photos/800/600?random=19',
        1578,
        base_date + INTERVAL '14 day',
        ARRAY['Hybrid Cloud', 'Cloud Architecture', 'Cloud Computing', 'Elastic Scaling', 'Cost Optimization'],
        0.93,
        true,
        'Hybrid Cloud Architecture - Enterprise Cloud Solutions',
        'Professional hybrid cloud design with elastic, secure, and cost-effective enterprise solutions',
        11
    );

    -- ===================================================================
    -- 插入日文业务项目数据
    -- ===================================================================
    
    INSERT INTO public.ak_contents (
        title, 
        content_summary, 
        content_type, 
        category_id, 
        original_language, 
        status, 
        featured_image_url,
        view_count,
        published_at,
        tags,
        quality_score,
        ai_processed,
        seo_title,
        seo_description,
        reading_time_minutes
    ) VALUES
    (
        'AIカスタマーサービスシステム',
        '自然言語処理と機械学習技術に基づく24時間AIカスタマーサービスソリューション。マルチターン対話、感情認識、知識グラフなどの先進機能を支援し、顧客サービス効率と満足度を大幅に向上させます。',
        'business_item',
        ai_category_id,
        'ja',
        'published',
        'https://picsum.photos/800/600?random=20',
        1256,
        base_date + INTERVAL '2 day',
        ARRAY['人工知能', 'カスタマーサービス', '自然言語処理', '機械学習', 'チャットボット'],
        0.94,
        true,
        'AIカスタマーサービス - インテリジェントサポートソリューション',
        '自然言語処理と感情認識を活用したプロフェッショナルなAIカスタマーサービスシステム',
        8
    ),
    (
        'コンピュータビジョン認識プラットフォーム',
        'ディープラーニングアルゴリズムを採用し、顔認識、物体検出、画像分類、OCR文字認識などのサービスを提供。セキュリティ監視、スマート製造、小売業界で広く応用されています。',
        'business_item',
        ai_category_id,
        'ja',
        'published',
        'https://picsum.photos/800/600?random=21',
        1134,
        base_date + INTERVAL '4 day',
        ARRAY['コンピュータビジョン', '画像認識', 'ディープラーニング', '顔認識', 'OCR'],
        0.91,
        true,
        'コンピュータビジョンプラットフォーム - AI画像認識ソリューション',
        'ディープラーニングベースの画像認識プラットフォーム、顔認識・物体検出・OCR対応',
        6
    );

    RAISE NOTICE '===================================================================';
    RAISE NOTICE 'Mock business_item 数据插入完成！';
    RAISE NOTICE '===================================================================';
    RAISE NOTICE '已插入数据统计：';
    RAISE NOTICE '- 中文业务项目：15个';
    RAISE NOTICE '- 英文业务项目：5个';
    RAISE NOTICE '- 日文业务项目：2个';
    RAISE NOTICE '- 总计：22个 business_item 类型内容';
    RAISE NOTICE '===================================================================';
    RAISE NOTICE '业务分类覆盖：';
    RAISE NOTICE '- 人工智能 (AI)';
    RAISE NOTICE '- 大数据分析 (Big Data)';
    RAISE NOTICE '- 物联网 (IoT)';
    RAISE NOTICE '- 云计算 (Cloud Computing)';
    RAISE NOTICE '- 区块链 (Blockchain)';
    RAISE NOTICE '- 移动开发 (Mobile Development)';
    RAISE NOTICE '- Web开发 (Web Development)';
    RAISE NOTICE '- 数据库 (Database)';
    RAISE NOTICE '- 网络安全 (Cybersecurity)';
    RAISE NOTICE '- 金融科技 (FinTech)';
    RAISE NOTICE '===================================================================';
    RAISE NOTICE '现在可以在 comindex.uvue 页面中测试业务项目展示功能了！';
    RAISE NOTICE '切换语言可以看到不同语言版本的业务项目。';
END
$$;

-- ===================================================================
-- 创建业务项目查询视图和函数
-- ===================================================================

-- 业务项目视图（支持多语言）
CREATE OR REPLACE VIEW public.vw_business_items_multilingual AS
SELECT 
    c.id,
    c.title,
    c.content_summary as description,
    c.featured_image_url as image_url,
    cc.name_key as category_key,
    c.original_language,
    c.published_at,
    c.view_count,
    c.status,
    c.tags,
    c.quality_score,
    c.reading_time_minutes,
    c.seo_title,
    c.seo_description,
    c.created_at,
    c.updated_at
FROM public.ak_contents c
LEFT JOIN public.ak_content_categories cc ON c.category_id = cc.id
WHERE c.content_type = 'business_item'
  AND c.status = 'published'
ORDER BY c.published_at DESC;

COMMENT ON VIEW public.vw_business_items_multilingual IS '多语言业务项目视图';

-- 获取指定语言的业务项目函数
CREATE OR REPLACE FUNCTION public.get_business_items_by_language(
    p_language_code VARCHAR(10) DEFAULT 'zh-CN',
    p_limit INTEGER DEFAULT 20,
    p_offset INTEGER DEFAULT 0
)
RETURNS TABLE (
    id UUID,
    title TEXT,
    description TEXT,
    image_url TEXT,
    category_key TEXT,
    publish_time TEXT,
    view_count INTEGER,
    tags TEXT[],
    reading_time INTEGER
) AS $$
BEGIN
    RETURN QUERY
    SELECT 
        c.id,
        c.title,
        c.content_summary as description,
        c.featured_image_url as image_url,
        COALESCE(cc.name_key, 'uncategorized') as category_key,
        TO_CHAR(c.published_at, 'YYYY-MM-DD') as publish_time,
        c.view_count,
        c.tags,
        c.reading_time_minutes as reading_time
    FROM public.ak_contents c
    LEFT JOIN public.ak_content_categories cc ON c.category_id = cc.id
    WHERE c.content_type = 'business_item'
        AND c.status = 'published'
        AND c.original_language = p_language_code
    ORDER BY c.published_at DESC
    LIMIT p_limit
    OFFSET p_offset;
END;
$$ LANGUAGE plpgsql;

COMMENT ON FUNCTION public.get_business_items_by_language IS '获取指定语言的业务项目列表';

-- 获取业务项目统计信息函数
CREATE OR REPLACE FUNCTION public.get_business_items_stats()
RETURNS TABLE (
    total_items INTEGER,
    language_code VARCHAR(10),
    language_count INTEGER,
    avg_quality_score NUMERIC,
    total_views BIGINT
) AS $$
BEGIN
    RETURN QUERY
    SELECT 
        COUNT(*)::INTEGER as total_items,
        c.original_language as language_code,
        COUNT(*)::INTEGER as language_count,
        ROUND(AVG(c.quality_score), 2) as avg_quality_score,
        SUM(c.view_count)::BIGINT as total_views
    FROM public.ak_contents c
    WHERE c.content_type = 'business_item'
        AND c.status = 'published'
    GROUP BY c.original_language
    ORDER BY language_count DESC;
END;
$$ LANGUAGE plpgsql;

COMMENT ON FUNCTION public.get_business_items_stats IS '获取业务项目统计信息';

-- 创建测试查询示例
DO $$
BEGIN
    RAISE NOTICE '===================================================================';
    RAISE NOTICE '测试查询示例：';
    RAISE NOTICE '===================================================================';
    RAISE NOTICE '1. 查看所有业务项目：';
    RAISE NOTICE '   SELECT * FROM public.vw_business_items_multilingual;';
    RAISE NOTICE '';
    RAISE NOTICE '2. 获取中文业务项目（前10个）：';
    RAISE NOTICE '   SELECT * FROM public.get_business_items_by_language(''zh-CN'', 10, 0);';
    RAISE NOTICE '';
    RAISE NOTICE '3. 获取英文业务项目：';
    RAISE NOTICE '   SELECT * FROM public.get_business_items_by_language(''en'', 10, 0);';
    RAISE NOTICE '';
    RAISE NOTICE '4. 查看业务项目统计：';
    RAISE NOTICE '   SELECT * FROM public.get_business_items_stats();';
    RAISE NOTICE '';
    RAISE NOTICE '5. 按分类查询（AI相关）：';
    RAISE NOTICE '   SELECT * FROM public.vw_business_items_multilingual ';
    RAISE NOTICE '   WHERE category_key = ''business.ai'';';
    RAISE NOTICE '===================================================================';
END
$$;
