-- 插入订单项数据
INSERT INTO order_items (order_id, product_name, quantity, unit_price, subtotal) 
SELECT 
    o.id as order_id,
    CASE 
        WHEN o.order_type = 'MEMBERSHIP' THEN 
            CASE 
                WHEN o.total_amount = 29.00 THEN '标准会员订阅'
                WHEN o.total_amount = 99.00 THEN '专业会员订阅'
                WHEN o.total_amount = 299.00 THEN '企业会员订阅'
                ELSE '会员订阅'
            END
        WHEN o.order_type = 'PRODUCT' THEN 
            CASE 
                WHEN o.total_amount = 49.00 THEN '基础视频生成'
                WHEN o.total_amount = 99.00 THEN '高级视频编辑'
                WHEN o.total_amount = 199.00 THEN '视频生成服务包'
                ELSE '视频服务'
            END
        ELSE '其他服务'
    END as product_name,
    1 as quantity,
    o.total_amount as unit_price,
    o.total_amount as subtotal
FROM orders o;
