-- 订餐系统模拟数据与菜单 SQL
-- 说明：本脚本使用 UTF-8 / utf8mb4，支持重复执行；仅清理本脚本生成的模拟数据，避免影响真实业务数据。
-- 目标：支撑小程序个人订餐、企业团餐、菜单展示、试算、下单、订单列表/详情和配送地址快照展示。

SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;
SET CHARACTER SET utf8mb4;

SET @tenant_code = CONVERT('1' USING utf8mb4) COLLATE utf8mb4_general_ci;
SET @tenant_id = '1';
SET @member_id = '2060184271063379970';
SET @member_name = '测试会员';
SET @member_phone = '13800000001';
SET @today = CURDATE();
SET @tomorrow = DATE_ADD(@today, INTERVAL 1 DAY);
SET @after_tomorrow = DATE_ADD(@today, INTERVAL 2 DAY);

SET @restaurant_id = 'MEAL_MOCK_RESTAURANT_001';
SET @service_area_id = 'MEAL_MOCK_SERVICE_AREA_001';
SET @service_area_name = '游客中心员工餐服务区';
SET @service_area_id_2 = 'MEAL_MOCK_SERVICE_AREA_002';
SET @service_area_name_2 = '酒文化展馆配送服务区';
SET @template_breakfast_id = 'MEAL_MOCK_TEMPLATE_BREAKFAST';
SET @template_lunch_id = 'MEAL_MOCK_TEMPLATE_LUNCH';
SET @template_dinner_id = 'MEAL_MOCK_TEMPLATE_DINNER';
SET @company_id = 'MEAL_MOCK_COMPANY_001';
SET @employee_id = 'MEAL_MOCK_EMPLOYEE_001';
SET @employee_frozen_id = 'MEAL_MOCK_EMPLOYEE_FROZEN_001';
SET @join_apply_pending_id = 'MEAL_MOCK_JOIN_APPLY_PENDING_001';
SET @join_apply_rejected_id = 'MEAL_MOCK_JOIN_APPLY_REJECTED_001';
SET @join_apply_approved_id = 'MEAL_MOCK_JOIN_APPLY_APPROVED_001';
SET @account_id = 'MEAL_MOCK_ACCOUNT_001';
SET @address_id = 'MEAL_MOCK_ADDRESS_001';

-- 安全清理旧模拟数据：仅清理当前租户下固定模拟前缀、模拟创建人或模拟备注的数据。
DELETE FROM app_food_meal_order_item
WHERE CAST(tenant_code AS BINARY) = CAST(@tenant_code AS BINARY)
  AND (id LIKE 'MEAL_MOCK_%' OR id LIKE 'MOCK_%' OR order_id LIKE 'MEAL_MOCK_ORDER_%' OR order_id LIKE 'MOCK_ORDER_%' OR create_by IN ('mock', 'meal_mock') OR remarks = '订餐模拟数据');

DELETE FROM biz_food_company_subsidy_use
WHERE CAST(tenant_code AS BINARY) = CAST(@tenant_code AS BINARY)
  AND (id LIKE 'MEAL_MOCK_%' OR id LIKE 'MOCK_%' OR order_id LIKE 'MEAL_MOCK_ORDER_%' OR order_id LIKE 'MOCK_ORDER_%' OR create_by IN ('mock', 'meal_mock') OR remarks = '订餐模拟数据');

DELETE FROM biz_food_company_account_log
WHERE CAST(tenant_code AS BINARY) = CAST(@tenant_code AS BINARY)
  AND (id LIKE 'MEAL_MOCK_%' OR id LIKE 'MOCK_%' OR biz_id LIKE 'MEAL_MOCK_%' OR biz_id LIKE 'MOCK_%' OR create_by IN ('mock', 'meal_mock') OR remarks = '订餐模拟数据');

DELETE FROM biz_food_company_recharge
WHERE CAST(tenant_code AS BINARY) = CAST(@tenant_code AS BINARY)
  AND (id LIKE 'MEAL_MOCK_%' OR id LIKE 'MOCK_%' OR create_by IN ('mock', 'meal_mock') OR remarks = '订餐模拟数据');

DELETE FROM app_food_meal_order
WHERE CAST(tenant_code AS BINARY) = CAST(@tenant_code AS BINARY)
  AND (id LIKE 'MEAL_MOCK_%' OR id LIKE 'MOCK_%' OR order_no LIKE 'MEALMOCK%' OR order_no LIKE 'MOCK%' OR create_by IN ('mock', 'meal_mock') OR remarks = '订餐模拟数据');

DELETE FROM biz_food_meal_menu_item_spec
WHERE CAST(tenant_code AS BINARY) = CAST(@tenant_code AS BINARY)
  AND (id LIKE 'MEAL_MOCK_%' OR id LIKE 'MOCK_%' OR menu_item_id LIKE 'MEAL_MOCK_ITEM_%' OR menu_item_id LIKE 'MOCK_ITEM_%' OR menu_id LIKE 'MEAL_MOCK_MENU_%' OR menu_id LIKE 'MOCK_MENU_%' OR create_by IN ('mock', 'meal_mock') OR remarks = '订餐模拟数据');

DELETE FROM biz_food_meal_menu_item
WHERE CAST(tenant_code AS BINARY) = CAST(@tenant_code AS BINARY)
  AND (id LIKE 'MEAL_MOCK_%' OR id LIKE 'MOCK_%' OR menu_id LIKE 'MEAL_MOCK_MENU_%' OR menu_id LIKE 'MOCK_MENU_%' OR create_by IN ('mock', 'meal_mock') OR remarks = '订餐模拟数据');

DELETE FROM biz_food_meal_menu
WHERE CAST(tenant_code AS BINARY) = CAST(@tenant_code AS BINARY)
  AND (id LIKE 'MEAL_MOCK_%' OR id LIKE 'MOCK_%' OR create_by IN ('mock', 'meal_mock') OR remarks = '订餐模拟数据');

DELETE FROM biz_food_meal_menu_template_item_spec
WHERE CAST(tenant_code AS BINARY) = CAST(@tenant_code AS BINARY)
  AND (id LIKE 'MEAL_MOCK_%' OR id LIKE 'MOCK_%' OR template_id LIKE 'MEAL_MOCK_TEMPLATE_%' OR create_by IN ('mock', 'meal_mock') OR remarks = '订餐模拟数据');

DELETE FROM biz_food_meal_menu_template_item
WHERE CAST(tenant_code AS BINARY) = CAST(@tenant_code AS BINARY)
  AND (id LIKE 'MEAL_MOCK_%' OR id LIKE 'MOCK_%' OR template_id LIKE 'MEAL_MOCK_TEMPLATE_%' OR create_by IN ('mock', 'meal_mock') OR remarks = '订餐模拟数据');

DELETE FROM biz_food_meal_menu_template
WHERE CAST(tenant_code AS BINARY) = CAST(@tenant_code AS BINARY)
  AND (id LIKE 'MEAL_MOCK_TEMPLATE_%' OR id LIKE 'MOCK_%' OR create_by IN ('mock', 'meal_mock') OR remarks = '订餐模拟数据');

DELETE FROM biz_food_meal_service_area
WHERE CAST(tenant_code AS BINARY) = CAST(@tenant_code AS BINARY)
  AND (id LIKE 'MEAL_MOCK_SERVICE_AREA_%' OR id LIKE 'MOCK_%' OR create_by IN ('mock', 'meal_mock') OR remarks = '订餐模拟数据');

DELETE FROM biz_food_company_subsidy_rule
WHERE CAST(tenant_code AS BINARY) = CAST(@tenant_code AS BINARY)
  AND (id LIKE 'MEAL_MOCK_%' OR id LIKE 'MOCK_%' OR create_by IN ('mock', 'meal_mock') OR remarks = '订餐模拟数据');

DELETE FROM biz_food_company_account
WHERE CAST(tenant_code AS BINARY) = CAST(@tenant_code AS BINARY)
  AND (id LIKE 'MEAL_MOCK_%' OR id LIKE 'MOCK_%' OR create_by IN ('mock', 'meal_mock') OR remarks = '订餐模拟数据');

DELETE FROM biz_food_company_join_apply
WHERE CAST(tenant_code AS BINARY) = CAST(@tenant_code AS BINARY)
  AND (id LIKE 'MEAL_MOCK_%' OR id LIKE 'MOCK_%' OR employee_id LIKE 'MEAL_MOCK_%' OR create_by IN ('mock', 'meal_mock') OR remarks = '订餐模拟数据');

DELETE FROM biz_food_company_employee
WHERE CAST(tenant_code AS BINARY) = CAST(@tenant_code AS BINARY)
  AND (id LIKE 'MEAL_MOCK_%' OR id LIKE 'MOCK_%' OR create_by IN ('mock', 'meal_mock') OR remarks = '订餐模拟数据');

DELETE FROM biz_food_company
WHERE CAST(tenant_code AS BINARY) = CAST(@tenant_code AS BINARY)
  AND (id LIKE 'MEAL_MOCK_%' OR id LIKE 'MOCK_%' OR create_by IN ('mock', 'meal_mock') OR remarks = '订餐模拟数据');

DELETE FROM biz_food_meal_rule
WHERE CAST(tenant_code AS BINARY) = CAST(@tenant_code AS BINARY)
  AND (id LIKE 'MEAL_MOCK_%' OR id LIKE 'MOCK_%' OR create_by IN ('mock', 'meal_mock') OR remarks = '订餐模拟数据');

DELETE FROM biz_food_package
WHERE CAST(tenant_code AS BINARY) = CAST(@tenant_code AS BINARY)
  AND (id LIKE 'MEAL_MOCK_%' OR id LIKE 'MOCK_%' OR create_by IN ('mock', 'meal_mock') OR remarks = '订餐模拟数据');

DELETE FROM biz_food_dish
WHERE CAST(tenant_code AS BINARY) = CAST(@tenant_code AS BINARY)
  AND (id LIKE 'MEAL_MOCK_%' OR id LIKE 'MOCK_%' OR create_by IN ('mock', 'meal_mock') OR remarks = '订餐模拟数据');

DELETE FROM biz_food_restaurant
WHERE CAST(tenant_code AS BINARY) = CAST(@tenant_code AS BINARY)
  AND (id LIKE 'MEAL_MOCK_%' OR id LIKE 'MOCK_%' OR create_by IN ('mock', 'meal_mock') OR remarks = '订餐模拟数据');

-- 门店
INSERT INTO biz_food_restaurant (
    id, name, category, rating, location_label, address, phone, distance_label,
    latitude, longitude, open_hours, cover, gallery_json, tags_json, notice_json, policy_json,
    meal_service_enabled, service_icon, floor_label, pickup_location, meal_open_status_text,
    status, sort_no, create_by, create_date, update_by, update_date, del_flag, remarks, tenant_code, tenant_id
) VALUES (
    @restaurant_id, '杏花村员工餐厅', '员工餐厅', 4.80, '杏花村游客中心东侧', '山西省汾阳市杏花村镇游客中心东侧', '0358-0000001', '约300m',
    37.265000, 111.781000, '07:00-20:00',
    'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20modern%20Chinese%20staff%20canteen%20restaurant%20interior%2C%20warm%20lighting%2C%20clean%20dining%20tables%2C%20commercial%20website%20photo&image_size=landscape_16_9',
    '[]', '["早餐","午餐","晚餐","企业团餐"]', '["请按预约餐别在营业时间内用餐或等待配送"]', '{"refund":"按订餐规则取消或退款"}',
    1, 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=flat%20icon%20Chinese%20meal%20service%20restaurant%20orange%20green&image_size=square', '游客中心一层东侧', '员工餐厅取餐台 / 游客中心东侧配送点', '今日三餐开放预订',
    1, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id
);

-- 订餐服务区域
INSERT INTO biz_food_meal_service_area (
    id, area_name, area_code, service_icon, location_label, floor_label, pickup_location,
    phone, open_hours, open_status_text, status, sort_no,
    create_by, create_date, update_by, update_date, del_flag, remarks, tenant_code, tenant_id
) VALUES
(
    @service_area_id, @service_area_name, 'MEAL-MOCK-AREA-001',
    'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=flat%20icon%20Chinese%20meal%20service%20restaurant%20orange%20green&image_size=square',
    '杏花村游客中心东侧', '游客中心一层东侧', '员工餐厅取餐台 / 游客中心东侧配送点',
    '0358-0000001', '07:00-20:00', '今日三餐开放预订', 1, 1,
    'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id
),
(
    @service_area_id_2, @service_area_name_2, 'MEAL-MOCK-AREA-002',
    'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=flat%20icon%20Chinese%20meal%20delivery%20service%20area%20blue%20green&image_size=square',
    '杏花村酒文化展馆西门', '酒文化展馆一层服务台', '展馆西门配送点 / 服务台自提',
    '0358-0000002', '09:00-18:30', '午餐开放预订', 1, 2,
    'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id
);

-- 菜品
INSERT INTO biz_food_dish (
    id, restaurant_id, category, name, subtitle, price, image_url, images_json,
    status, sort_no, create_by, create_date, update_by, update_date, del_flag, remarks, tenant_code, tenant_id
) VALUES
('MEAL_MOCK_DISH_BF_001', @restaurant_id, 'breakfast', '小米南瓜粥', '暖胃早餐粥，搭配粗粮更健康', 8.00, 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20millet%20pumpkin%20porridge%20in%20ceramic%20bowl%2C%20breakfast%20food%20photography&image_size=square', '[]', 1, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_DISH_BF_002', @restaurant_id, 'breakfast', '鸡蛋蔬菜包', '现蒸松软包子，内馅清爽', 6.00, 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20steamed%20Chinese%20vegetable%20buns%20with%20egg%2C%20breakfast%20plate%2C%20food%20photography&image_size=square', '[]', 1, 2, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_DISH_BF_003', @restaurant_id, 'breakfast', '豆浆油条套餐', '经典中式早餐组合', 10.00, 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20soy%20milk%20and%20fried%20dough%20sticks%20breakfast%2C%20clean%20table%2C%20food%20photo&image_size=square', '[]', 1, 3, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_DISH_LU_001', @restaurant_id, 'lunch', '杏花村黄焖鸡', '酱香浓郁，配时令蔬菜', 28.00, 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20braised%20chicken%20rice%20set%20meal%2C%20vegetables%2C%20restaurant%20food%20photo&image_size=square', '[]', 1, 10, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_DISH_LU_002', @restaurant_id, 'lunch', '汾州牛肉面', '牛肉软烂，汤头醇厚', 22.00, 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20beef%20noodle%20soup%2C%20sliced%20beef%2C%20green%20onion%2C%20food%20photography&image_size=square', '[]', 1, 11, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_DISH_LU_003', @restaurant_id, 'lunch', '番茄鸡蛋盖饭', '酸甜开胃，家常口味', 18.00, 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20tomato%20egg%20rice%20bowl%2C%20Chinese%20canteen%20lunch%2C%20food%20photography&image_size=square', '[]', 1, 12, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_DISH_DN_001', @restaurant_id, 'dinner', '清炒时蔬', '低脂清爽，晚餐优选', 12.00, 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20stir%20fried%20seasonal%20green%20vegetables%2C%20healthy%20dinner%2C%20food%20photo&image_size=square', '[]', 1, 20, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_DISH_DN_002', @restaurant_id, 'dinner', '山西刀削面', '筋道面条，汤香味足', 20.00, 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Shanxi%20knife%20cut%20noodles%20bowl%2C%20Chinese%20dinner%2C%20food%20photography&image_size=square', '[]', 1, 21, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_DISH_DN_003', @restaurant_id, 'dinner', '土豆烧牛腩', '软糯土豆配浓香牛腩', 32.00, 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20braised%20beef%20brisket%20with%20potatoes%2C%20dinner%20dish%2C%20food%20photo&image_size=square', '[]', 1, 22, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id);

-- 套餐
INSERT INTO biz_food_package (
    id, restaurant_id, name, subtitle, price, original_price, includes_json, images_json, stock_hint,
    status, online_order_enabled, sort_no, max_quantity_per_order, available_quantity,
    create_by, create_date, update_by, update_date, del_flag, remarks, tenant_code, tenant_id
) VALUES
('MEAL_MOCK_PACKAGE_001', @restaurant_id, '午餐双拼套餐', '黄焖鸡+清炒时蔬+米饭+例汤', 38.00, 48.00, '["黄焖鸡","清炒时蔬","米饭","例汤"]', '["https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20lunch%20set%20meal%20with%20braised%20chicken%2C%20vegetables%2C%20rice%20and%20soup&image_size=square"]', '每日限量', 1, 1, 1, 2, 100, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_PACKAGE_002', @restaurant_id, '晚餐轻食套餐', '刀削面小份+时蔬+酸奶', 28.00, 36.00, '["刀削面小份","清炒时蔬","酸奶"]', '["https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20light%20dinner%20set%20with%20noodles%2C%20vegetables%20and%20yogurt%2C%20food%20photo&image_size=square"]', '健康晚餐', 1, 1, 2, 2, 100, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id);

-- 订餐规则
INSERT INTO biz_food_meal_rule (
    id, restaurant_id, service_area_id, service_area_name, meal_type, scope_type, advance_hours, advance_days, fixed_deadline_time,
    bookable_future_days, cancel_rule_type, cancel_deadline_hours, status,
    create_by, create_date, update_by, update_date, del_flag, remarks, tenant_code, tenant_id
) VALUES
('MEAL_MOCK_RULE_P_BF', @restaurant_id, @service_area_id, @service_area_name, 'breakfast', 'personal', 0, 0, '08:30:00', 7, 'before_deadline', 1, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_RULE_P_LU', @restaurant_id, @service_area_id, @service_area_name, 'lunch', 'personal', 0, 0, '11:30:00', 7, 'before_deadline', 1, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_RULE_P_DN', @restaurant_id, @service_area_id, @service_area_name, 'dinner', 'personal', 0, 0, '17:30:00', 7, 'before_deadline', 1, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_RULE_P2_LU', @restaurant_id, @service_area_id_2, @service_area_name_2, 'lunch', 'personal', 0, 0, '11:30:00', 7, 'before_deadline', 1, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_RULE_C_BF', @restaurant_id, @service_area_id, @service_area_name, 'breakfast', 'company', 0, 0, '08:30:00', 7, 'before_deadline', 1, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_RULE_C_LU', @restaurant_id, @service_area_id, @service_area_name, 'lunch', 'company', 0, 0, '11:30:00', 7, 'before_deadline', 1, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_RULE_C_DN', @restaurant_id, @service_area_id, @service_area_name, 'dinner', 'company', 0, 0, '17:30:00', 7, 'before_deadline', 1, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id);

-- 企业、员工、账户、补贴规则
INSERT INTO biz_food_company (
    id, company_code, company_name, contact_name, contact_phone, status,
    create_by, create_date, update_by, update_date, del_flag, remarks, tenant_code, tenant_id
) VALUES (
    @company_id, 'MEAL-MOCK-COMPANY-001', '杏花村文旅示范企业', '企业管理员', '13800000002', 1,
    'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id
);

INSERT INTO biz_food_company_employee (
    id, company_id, member_id, member_no, employee_no, employee_name, mobile, status, bind_status,
    bind_time, unbind_time, source, create_by, create_date, update_by, update_date, del_flag, remarks, tenant_code, tenant_id
) VALUES
(
    @employee_id, @company_id, @member_id, 'MEAL-MOCK-MEMBER-001', 'EMP001', @member_name, @member_phone, 1, 1,
    NOW(), NULL, 'ADMIN', 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id
),
(
    @employee_frozen_id, @company_id, 'MEAL_MOCK_MEMBER_FROZEN_001', 'MEAL-MOCK-MEMBER-002', 'EMP002', '冻结员工', '13800000003', 0, 1,
    DATE_SUB(NOW(), INTERVAL 2 DAY), NULL, 'ADMIN', 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id
);

INSERT INTO biz_food_company_join_apply (
    id, company_id, company_code, company_name, member_id, member_no, employee_id, employee_no,
    employee_name, mobile, apply_reason, apply_time, status, audit_user_id, audit_user_name, audit_time, audit_remark,
    create_by, create_date, update_by, update_date, del_flag, remarks, tenant_code, tenant_id
) VALUES
(
    @join_apply_pending_id, @company_id, 'MEAL-MOCK-COMPANY-001', '杏花村文旅示范企业', 'MEAL_MOCK_MEMBER_PENDING_001', 'MEAL-MOCK-MEMBER-003', NULL, 'EMP003',
    '待审批员工', '13800000004', '申请加入企业团餐', DATE_SUB(NOW(), INTERVAL 1 HOUR), 'pending', NULL, NULL, NULL, NULL,
    'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id
),
(
    @join_apply_rejected_id, @company_id, 'MEAL-MOCK-COMPANY-001', '杏花村文旅示范企业', 'MEAL_MOCK_MEMBER_REJECTED_001', 'MEAL-MOCK-MEMBER-004', NULL, 'EMP004',
    '已拒绝员工', '13800000005', '信息待核验', DATE_SUB(NOW(), INTERVAL 1 DAY), 'rejected', 'meal_mock', '模拟管理员', DATE_SUB(NOW(), INTERVAL 20 HOUR), '企业信息未核验通过',
    'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id
),
(
    @join_apply_approved_id, @company_id, 'MEAL-MOCK-COMPANY-001', '杏花村文旅示范企业', @member_id, 'MEAL-MOCK-MEMBER-001', @employee_id, 'EMP001',
    @member_name, @member_phone, '已有员工绑定审批记录', DATE_SUB(NOW(), INTERVAL 2 DAY), 'approved', 'meal_mock', '模拟管理员', DATE_SUB(NOW(), INTERVAL 1 DAY), '已关联现有员工',
    'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id
);

INSERT INTO biz_food_company_account (
    id, company_id, available_balance, frozen_balance, total_recharge_amount, total_consume_amount, total_refund_amount,
    status, create_by, create_date, update_by, update_date, del_flag, remarks, tenant_code, tenant_id
) VALUES (
    @account_id, @company_id, 5000.00, 0.00, 5000.00, 53.00, 0.00,
    1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id
);

INSERT INTO biz_food_company_subsidy_rule (
    id, company_id, rule_name, rule_type, subsidy_amount, discount_rate, daily_limit_amount, meal_limit_amount,
    meal_types, effective_time, expire_time, status, create_by, create_date, update_by, update_date, del_flag, remarks, tenant_code, tenant_id
) VALUES
('MEAL_MOCK_SUBSIDY_LUNCH', @company_id, '午餐固定补贴15元', 'SUBSIDY', 15.00, 1.0000, 100.00, 30.00, 'lunch', DATE_SUB(NOW(), INTERVAL 1 DAY), DATE_ADD(NOW(), INTERVAL 1 YEAR), 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_DISCOUNT_DINNER', @company_id, '晚餐企业八折价', 'DISCOUNT', 0.00, 0.8000, NULL, NULL, 'dinner', DATE_SUB(NOW(), INTERVAL 1 DAY), DATE_ADD(NOW(), INTERVAL 1 YEAR), 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id);

-- 菜单模板
INSERT INTO biz_food_meal_menu_template (
    id, template_name, template_code, meal_type, scope_type, description, status, sort_no,
    create_by, create_date, update_by, update_date, del_flag, remarks, tenant_code, tenant_id
) VALUES
(@template_breakfast_id, '游客中心早餐模板', 'MEAL-MOCK-TEMPLATE-BREAKFAST', 'breakfast', 'all', '游客中心员工餐服务区早餐基础菜单模板', 1, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
(@template_lunch_id, '游客中心午餐模板', 'MEAL-MOCK-TEMPLATE-LUNCH', 'lunch', 'all', '游客中心员工餐服务区午餐基础菜单模板', 1, 2, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
(@template_dinner_id, '游客中心晚餐模板', 'MEAL-MOCK-TEMPLATE-DINNER', 'dinner', 'all', '游客中心员工餐服务区晚餐基础菜单模板', 1, 3, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id);

INSERT INTO biz_food_meal_menu_template_item (
    id, template_id, item_type, dish_id, package_id, item_name, item_image,
    images_json, tags_json, description_html, sale_price, stock_quantity, limit_quantity_per_user, sort_no,
    create_by, create_date, update_by, update_date, del_flag, remarks, tenant_code, tenant_id
) VALUES
('MEAL_MOCK_TEMPLATE_ITEM_BF_001', @template_breakfast_id, 'dish', 'MEAL_MOCK_DISH_BF_001', NULL, '小米南瓜粥', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20millet%20pumpkin%20porridge%20in%20ceramic%20bowl%2C%20breakfast%20food%20photography&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20millet%20pumpkin%20porridge%20in%20ceramic%20bowl%2C%20breakfast%20food%20photography&image_size=square'), '["暖胃","低脂","早餐"]', '<p>小米与南瓜慢熬，口感绵密，适合清晨暖胃。</p>', 8.00, 80, 3, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_TEMPLATE_ITEM_BF_002', @template_breakfast_id, 'dish', 'MEAL_MOCK_DISH_BF_002', NULL, '鸡蛋蔬菜包', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20steamed%20Chinese%20vegetable%20buns%20with%20egg%2C%20breakfast%20plate%2C%20food%20photography&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20steamed%20Chinese%20vegetable%20buns%20with%20egg%2C%20breakfast%20plate%2C%20food%20photography&image_size=square'), '["现蒸","素馅","早餐"]', '<p>每日现蒸，鸡蛋蔬菜馅清爽不腻。</p>', 6.00, 120, 5, 2, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_TEMPLATE_ITEM_BF_003', @template_breakfast_id, 'dish', 'MEAL_MOCK_DISH_BF_003', NULL, '豆浆油条套餐', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20soy%20milk%20and%20fried%20dough%20sticks%20breakfast%2C%20clean%20table%2C%20food%20photo&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20soy%20milk%20and%20fried%20dough%20sticks%20breakfast%2C%20clean%20table%2C%20food%20photo&image_size=square'), '["经典","热卖","早餐"]', '<p>现磨豆浆搭配酥脆油条，经典中式早餐组合。</p>', 10.00, 90, 3, 3, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_TEMPLATE_ITEM_LU_001', @template_lunch_id, 'dish', 'MEAL_MOCK_DISH_LU_001', NULL, '杏花村黄焖鸡', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20braised%20chicken%20rice%20set%20meal%2C%20vegetables%2C%20restaurant%20food%20photo&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20braised%20chicken%20rice%20set%20meal%2C%20vegetables%2C%20restaurant%20food%20photo&image_size=square'), '["招牌","午餐","下饭"]', '<p>鸡肉焖至入味，酱香浓郁，搭配米饭更佳。</p>', 28.00, 100, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_TEMPLATE_ITEM_LU_002', @template_lunch_id, 'dish', 'MEAL_MOCK_DISH_LU_002', NULL, '汾州牛肉面', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20beef%20noodle%20soup%2C%20sliced%20beef%2C%20green%20onion%2C%20food%20photography&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20beef%20noodle%20soup%2C%20sliced%20beef%2C%20green%20onion%2C%20food%20photography&image_size=square'), '["热汤","牛肉","午餐"]', '<p>牛肉软烂，汤头醇厚，适合午餐补充能量。</p>', 22.00, 100, 2, 2, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_TEMPLATE_ITEM_LU_003', @template_lunch_id, 'package', NULL, 'MEAL_MOCK_PACKAGE_001', '午餐双拼套餐', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20lunch%20set%20meal%20with%20braised%20chicken%2C%20vegetables%2C%20rice%20and%20soup&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20lunch%20set%20meal%20with%20braised%20chicken%2C%20vegetables%2C%20rice%20and%20soup&image_size=square'), '["套餐","荤素搭配","午餐"]', '<p>黄焖鸡、时蔬、米饭和例汤组合，营养均衡。</p>', 38.00, 60, 2, 3, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_TEMPLATE_ITEM_DN_001', @template_dinner_id, 'dish', 'MEAL_MOCK_DISH_DN_001', NULL, '清炒时蔬', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20stir%20fried%20seasonal%20green%20vegetables%2C%20healthy%20dinner%2C%20food%20photo&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20stir%20fried%20seasonal%20green%20vegetables%2C%20healthy%20dinner%2C%20food%20photo&image_size=square'), '["清爽","低脂","晚餐"]', '<p>精选时令绿叶菜清炒，口味清淡，晚餐优选。</p>', 12.00, 100, 3, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_TEMPLATE_ITEM_DN_002', @template_dinner_id, 'dish', 'MEAL_MOCK_DISH_DN_002', NULL, '山西刀削面', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Shanxi%20knife%20cut%20noodles%20bowl%2C%20Chinese%20dinner%2C%20food%20photography&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Shanxi%20knife%20cut%20noodles%20bowl%2C%20Chinese%20dinner%2C%20food%20photography&image_size=square'), '["地方风味","面食","晚餐"]', '<p>面条筋道，汤香味足，呈现山西地方风味。</p>', 20.00, 80, 2, 2, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_TEMPLATE_ITEM_DN_003', @template_dinner_id, 'package', NULL, 'MEAL_MOCK_PACKAGE_002', '晚餐轻食套餐', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20light%20dinner%20set%20with%20noodles%2C%20vegetables%20and%20yogurt%2C%20food%20photo&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20light%20dinner%20set%20with%20noodles%2C%20vegetables%20and%20yogurt%2C%20food%20photo&image_size=square'), '["轻食","套餐","晚餐"]', '<p>小份面食、时蔬与酸奶搭配，控制晚餐负担。</p>', 28.00, 60, 2, 3, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_TEMPLATE_ITEM_LU_004', @template_lunch_id, 'dish', 'MEAL_MOCK_DISH_LU_003', NULL, '番茄鸡蛋盖饭', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20tomato%20egg%20rice%20bowl%2C%20Chinese%20canteen%20lunch%2C%20food%20photography&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20tomato%20egg%20rice%20bowl%2C%20Chinese%20canteen%20lunch%2C%20food%20photography&image_size=square'), '["家常","午餐","酸甜"]', '<p>番茄酸甜开胃，鸡蛋软嫩，家常午餐选择。</p>', 18.00, 100, 2, 4, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_TEMPLATE_ITEM_DN_004', @template_dinner_id, 'dish', 'MEAL_MOCK_DISH_DN_003', NULL, '土豆烧牛腩', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20braised%20beef%20brisket%20with%20potatoes%2C%20dinner%20dish%2C%20food%20photo&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20braised%20beef%20brisket%20with%20potatoes%2C%20dinner%20dish%2C%20food%20photo&image_size=square'), '["炖菜","牛腩","晚餐"]', '<p>牛腩软烂、土豆绵糯，晚餐饱腹感强。</p>', 32.00, 80, 2, 4, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id);

INSERT INTO biz_food_meal_menu_template_item_spec (
    id, template_id, template_item_id, spec_name, spec_description,
    sale_price, stock_quantity, limit_quantity_per_user, sort_no,
    create_by, create_date, update_by, update_date, del_flag, remarks, tenant_code, tenant_id
) VALUES
('MEAL_MOCK_TEMPLATE_SPEC_LU_001_A', @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_001', '一荤两素', '黄焖鸡+清炒时蔬+番茄鸡蛋', 28.00, 60, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_TEMPLATE_SPEC_LU_001_B', @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_001', '二荤一素', '黄焖鸡+土豆烧牛腩+清炒时蔬', 35.00, 40, 2, 2, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_TEMPLATE_SPEC_LU_002_A', @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_002', '标准份', '常规牛肉面份量', 22.00, 80, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_TEMPLATE_SPEC_LU_002_B', @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_002', '加量份', '加面加牛肉', 28.00, 40, 1, 2, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_TEMPLATE_SPEC_LU_003_A', @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_003', '一荤两素', '黄焖鸡+清炒时蔬+番茄鸡蛋，企业标准餐', 38.00, 60, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_TEMPLATE_SPEC_LU_003_B', @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_003', '二荤一素', '黄焖鸡+土豆烧牛腩+清炒时蔬，企业加餐', 45.00, 50, 2, 2, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_TEMPLATE_SPEC_DN_002_A', @template_dinner_id, 'MEAL_MOCK_TEMPLATE_ITEM_DN_002', '标准份', '常规刀削面份量', 20.00, 60, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_TEMPLATE_SPEC_DN_002_B', @template_dinner_id, 'MEAL_MOCK_TEMPLATE_ITEM_DN_002', '加量份', '加面加卤', 25.00, 30, 1, 2, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id);

-- 菜单主表：个人 public 与企业 company，覆盖今天/明天/后天早餐午餐晚餐。
INSERT INTO biz_food_meal_menu (
    id, restaurant_id, service_area_id, service_area_name, menu_date, meal_type, scope_type, company_id, company_name,
    template_id, template_name, publish_status, publish_time, sort_no,
    create_by, create_date, update_by, update_date, del_flag, remarks, tenant_code, tenant_id
) VALUES
('MEAL_MOCK_MENU_P_T0_BF', @restaurant_id, @service_area_id, @service_area_name, @today, 'breakfast', 'public', NULL, NULL, @template_breakfast_id, '游客中心早餐模板', 'published', NOW(), 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_MENU_P_T0_LU', @restaurant_id, @service_area_id, @service_area_name, @today, 'lunch', 'public', NULL, NULL, @template_lunch_id, '游客中心午餐模板', 'published', NOW(), 2, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_MENU_P_T0_DN', @restaurant_id, @service_area_id, @service_area_name, @today, 'dinner', 'public', NULL, NULL, @template_dinner_id, '游客中心晚餐模板', 'published', NOW(), 3, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_MENU_P_T1_BF', @restaurant_id, @service_area_id, @service_area_name, @tomorrow, 'breakfast', 'public', NULL, NULL, @template_breakfast_id, '游客中心早餐模板', 'published', NOW(), 4, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_MENU_P_T1_LU', @restaurant_id, @service_area_id, @service_area_name, @tomorrow, 'lunch', 'public', NULL, NULL, @template_lunch_id, '游客中心午餐模板', 'published', NOW(), 5, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_MENU_P_T1_DN', @restaurant_id, @service_area_id, @service_area_name, @tomorrow, 'dinner', 'public', NULL, NULL, @template_dinner_id, '游客中心晚餐模板', 'published', NOW(), 6, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_MENU_P_T2_BF', @restaurant_id, @service_area_id, @service_area_name, @after_tomorrow, 'breakfast', 'public', NULL, NULL, @template_breakfast_id, '游客中心早餐模板', 'published', NOW(), 7, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_MENU_P_T2_LU', @restaurant_id, @service_area_id, @service_area_name, @after_tomorrow, 'lunch', 'public', NULL, NULL, @template_lunch_id, '游客中心午餐模板', 'published', NOW(), 8, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_MENU_P_T2_DN', @restaurant_id, @service_area_id, @service_area_name, @after_tomorrow, 'dinner', 'public', NULL, NULL, @template_dinner_id, '游客中心晚餐模板', 'published', NOW(), 9, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_MENU_C_T0_BF', @restaurant_id, @service_area_id, @service_area_name, @today, 'breakfast', 'company', @company_id, '杏花村文旅示范企业', @template_breakfast_id, '游客中心早餐模板', 'published', NOW(), 11, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_MENU_C_T0_LU', @restaurant_id, @service_area_id, @service_area_name, @today, 'lunch', 'company', @company_id, '杏花村文旅示范企业', @template_lunch_id, '游客中心午餐模板', 'published', NOW(), 12, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_MENU_C_T0_DN', @restaurant_id, @service_area_id, @service_area_name, @today, 'dinner', 'company', @company_id, '杏花村文旅示范企业', @template_dinner_id, '游客中心晚餐模板', 'published', NOW(), 13, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_MENU_C_T1_BF', @restaurant_id, @service_area_id, @service_area_name, @tomorrow, 'breakfast', 'company', @company_id, '杏花村文旅示范企业', @template_breakfast_id, '游客中心早餐模板', 'published', NOW(), 14, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_MENU_C_T1_LU', @restaurant_id, @service_area_id, @service_area_name, @tomorrow, 'lunch', 'company', @company_id, '杏花村文旅示范企业', @template_lunch_id, '游客中心午餐模板', 'published', NOW(), 15, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_MENU_C_T1_DN', @restaurant_id, @service_area_id, @service_area_name, @tomorrow, 'dinner', 'company', @company_id, '杏花村文旅示范企业', @template_dinner_id, '游客中心晚餐模板', 'published', NOW(), 16, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_MENU_C_T2_BF', @restaurant_id, @service_area_id, @service_area_name, @after_tomorrow, 'breakfast', 'company', @company_id, '杏花村文旅示范企业', @template_breakfast_id, '游客中心早餐模板', 'published', NOW(), 17, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_MENU_C_T2_LU', @restaurant_id, @service_area_id, @service_area_name, @after_tomorrow, 'lunch', 'company', @company_id, '杏花村文旅示范企业', @template_lunch_id, '游客中心午餐模板', 'published', NOW(), 18, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_MENU_C_T2_DN', @restaurant_id, @service_area_id, @service_area_name, @after_tomorrow, 'dinner', 'company', @company_id, '杏花村文旅示范企业', @template_dinner_id, '游客中心晚餐模板', 'published', NOW(), 19, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_MENU_P2_T1_LU', @restaurant_id, @service_area_id_2, @service_area_name_2, @tomorrow, 'lunch', 'public', NULL, NULL, @template_lunch_id, '游客中心午餐模板', 'published', NOW(), 20, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id);

-- 菜单明细
INSERT INTO biz_food_meal_menu_item (
    id, menu_id, restaurant_id, service_area_id, template_id, template_item_id, item_type, dish_id, package_id, item_name, item_image,
    images_json, tags_json, description_html,
    sale_price, stock_quantity, sold_quantity, limit_quantity_per_user, sort_no,
    create_by, create_date, update_by, update_date, del_flag, remarks, tenant_code, tenant_id
) VALUES
('MEAL_MOCK_ITEM_P_T0_BF_001', 'MEAL_MOCK_MENU_P_T0_BF', @restaurant_id, @service_area_id, @template_breakfast_id, 'MEAL_MOCK_TEMPLATE_ITEM_BF_001', 'dish', 'MEAL_MOCK_DISH_BF_001', NULL, '小米南瓜粥', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20millet%20pumpkin%20porridge%20in%20ceramic%20bowl%2C%20breakfast%20food%20photography&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20millet%20pumpkin%20porridge%20in%20ceramic%20bowl%2C%20breakfast%20food%20photography&image_size=square'), '["暖胃","低脂","早餐"]', '<p>小米与南瓜慢熬，口感绵密，适合清晨暖胃。</p>', 8.00, 80, 5, 3, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_P_T0_BF_002', 'MEAL_MOCK_MENU_P_T0_BF', @restaurant_id, @service_area_id, @template_breakfast_id, 'MEAL_MOCK_TEMPLATE_ITEM_BF_002', 'dish', 'MEAL_MOCK_DISH_BF_002', NULL, '鸡蛋蔬菜包', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20steamed%20Chinese%20vegetable%20buns%20with%20egg%2C%20breakfast%20plate%2C%20food%20photography&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20steamed%20Chinese%20vegetable%20buns%20with%20egg%2C%20breakfast%20plate%2C%20food%20photography&image_size=square'), '["现蒸","素馅","早餐"]', '<p>每日现蒸，鸡蛋蔬菜馅清爽不腻。</p>', 6.00, 120, 10, 5, 2, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_P_T0_BF_003', 'MEAL_MOCK_MENU_P_T0_BF', @restaurant_id, @service_area_id, @template_breakfast_id, 'MEAL_MOCK_TEMPLATE_ITEM_BF_003', 'dish', 'MEAL_MOCK_DISH_BF_003', NULL, '豆浆油条套餐', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20soy%20milk%20and%20fried%20dough%20sticks%20breakfast%2C%20clean%20table%2C%20food%20photo&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20soy%20milk%20and%20fried%20dough%20sticks%20breakfast%2C%20clean%20table%2C%20food%20photo&image_size=square'), '["经典","热卖","早餐"]', '<p>现磨豆浆搭配酥脆油条，经典中式早餐组合。</p>', 10.00, 90, 12, 3, 3, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_P_T0_LU_001', 'MEAL_MOCK_MENU_P_T0_LU', @restaurant_id, @service_area_id, @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_001', 'dish', 'MEAL_MOCK_DISH_LU_001', NULL, '杏花村黄焖鸡', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20braised%20chicken%20rice%20set%20meal%2C%20vegetables%2C%20restaurant%20food%20photo&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20braised%20chicken%20rice%20set%20meal%2C%20vegetables%2C%20restaurant%20food%20photo&image_size=square'), '["招牌","午餐","下饭"]', '<p>鸡肉焖至入味，酱香浓郁，搭配米饭更佳。</p>', 28.00, 100, 18, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_P_T0_LU_002', 'MEAL_MOCK_MENU_P_T0_LU', @restaurant_id, @service_area_id, @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_002', 'dish', 'MEAL_MOCK_DISH_LU_002', NULL, '汾州牛肉面', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20beef%20noodle%20soup%2C%20sliced%20beef%2C%20green%20onion%2C%20food%20photography&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20beef%20noodle%20soup%2C%20sliced%20beef%2C%20green%20onion%2C%20food%20photography&image_size=square'), '["热汤","牛肉","午餐"]', '<p>牛肉软烂，汤头醇厚，适合午餐补充能量。</p>', 22.00, 100, 20, 2, 2, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_P_T0_LU_003', 'MEAL_MOCK_MENU_P_T0_LU', @restaurant_id, @service_area_id, @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_003', 'package', NULL, 'MEAL_MOCK_PACKAGE_001', '午餐双拼套餐', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20lunch%20set%20meal%20with%20braised%20chicken%2C%20vegetables%2C%20rice%20and%20soup&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20lunch%20set%20meal%20with%20braised%20chicken%2C%20vegetables%2C%20rice%20and%20soup&image_size=square'), '["套餐","荤素搭配","午餐"]', '<p>黄焖鸡、时蔬、米饭和例汤组合，营养均衡。</p>', 38.00, 60, 8, 2, 3, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_P_T0_DN_001', 'MEAL_MOCK_MENU_P_T0_DN', @restaurant_id, @service_area_id, @template_dinner_id, 'MEAL_MOCK_TEMPLATE_ITEM_DN_001', 'dish', 'MEAL_MOCK_DISH_DN_001', NULL, '清炒时蔬', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20stir%20fried%20seasonal%20green%20vegetables%2C%20healthy%20dinner%2C%20food%20photo&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20stir%20fried%20seasonal%20green%20vegetables%2C%20healthy%20dinner%2C%20food%20photo&image_size=square'), '["清爽","低脂","晚餐"]', '<p>精选时令绿叶菜清炒，口味清淡，晚餐优选。</p>', 12.00, 100, 10, 3, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_P_T0_DN_002', 'MEAL_MOCK_MENU_P_T0_DN', @restaurant_id, @service_area_id, @template_dinner_id, 'MEAL_MOCK_TEMPLATE_ITEM_DN_002', 'dish', 'MEAL_MOCK_DISH_DN_002', NULL, '山西刀削面', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Shanxi%20knife%20cut%20noodles%20bowl%2C%20Chinese%20dinner%2C%20food%20photography&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Shanxi%20knife%20cut%20noodles%20bowl%2C%20Chinese%20dinner%2C%20food%20photography&image_size=square'), '["地方风味","面食","晚餐"]', '<p>面条筋道，汤香味足，呈现山西地方风味。</p>', 20.00, 80, 14, 2, 2, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_P_T0_DN_003', 'MEAL_MOCK_MENU_P_T0_DN', @restaurant_id, @service_area_id, @template_dinner_id, 'MEAL_MOCK_TEMPLATE_ITEM_DN_003', 'package', NULL, 'MEAL_MOCK_PACKAGE_002', '晚餐轻食套餐', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20light%20dinner%20set%20with%20noodles%2C%20vegetables%20and%20yogurt%2C%20food%20photo&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20light%20dinner%20set%20with%20noodles%2C%20vegetables%20and%20yogurt%2C%20food%20photo&image_size=square'), '["轻食","套餐","晚餐"]', '<p>小份面食、时蔬与酸奶搭配，控制晚餐负担。</p>', 28.00, 60, 6, 2, 3, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_P_T1_BF_001', 'MEAL_MOCK_MENU_P_T1_BF', @restaurant_id, @service_area_id, @template_breakfast_id, 'MEAL_MOCK_TEMPLATE_ITEM_BF_001', 'dish', 'MEAL_MOCK_DISH_BF_001', NULL, '小米南瓜粥', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20millet%20pumpkin%20porridge%20in%20ceramic%20bowl%2C%20breakfast%20food%20photography&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20millet%20pumpkin%20porridge%20in%20ceramic%20bowl%2C%20breakfast%20food%20photography&image_size=square'), '["暖胃","早餐","可预订"]', '<p>提前预订明日早餐，取餐更从容。</p>', 8.00, 80, 0, 3, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_P_T1_LU_001', 'MEAL_MOCK_MENU_P_T1_LU', @restaurant_id, @service_area_id, @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_001', 'dish', 'MEAL_MOCK_DISH_LU_001', NULL, '杏花村黄焖鸡', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20braised%20chicken%20rice%20set%20meal%2C%20vegetables%2C%20restaurant%20food%20photo&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20braised%20chicken%20rice%20set%20meal%2C%20vegetables%2C%20restaurant%20food%20photo&image_size=square'), '["招牌","午餐","可预订"]', '<p>明日午餐招牌菜，适合个人订餐。</p>', 28.00, 100, 0, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_P_T1_DN_001', 'MEAL_MOCK_MENU_P_T1_DN', @restaurant_id, @service_area_id, @template_dinner_id, 'MEAL_MOCK_TEMPLATE_ITEM_DN_003', 'package', NULL, 'MEAL_MOCK_PACKAGE_002', '晚餐轻食套餐', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20light%20dinner%20set%20with%20noodles%2C%20vegetables%20and%20yogurt%2C%20food%20photo&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20light%20dinner%20set%20with%20noodles%2C%20vegetables%20and%20yogurt%2C%20food%20photo&image_size=square'), '["轻食","晚餐","可预订"]', '<p>明日晚餐轻食组合，适合下班后取餐。</p>', 28.00, 60, 0, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_P_T2_BF_001', 'MEAL_MOCK_MENU_P_T2_BF', @restaurant_id, @service_area_id, @template_breakfast_id, 'MEAL_MOCK_TEMPLATE_ITEM_BF_003', 'dish', 'MEAL_MOCK_DISH_BF_003', NULL, '豆浆油条套餐', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20soy%20milk%20and%20fried%20dough%20sticks%20breakfast%2C%20clean%20table%2C%20food%20photo&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20soy%20milk%20and%20fried%20dough%20sticks%20breakfast%2C%20clean%20table%2C%20food%20photo&image_size=square'), '["经典","早餐","可预订"]', '<p>后天早餐可提前锁定，减少排队等待。</p>', 10.00, 90, 0, 3, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_P_T2_LU_001', 'MEAL_MOCK_MENU_P_T2_LU', @restaurant_id, @service_area_id, @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_004', 'dish', 'MEAL_MOCK_DISH_LU_003', NULL, '番茄鸡蛋盖饭', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20tomato%20egg%20rice%20bowl%2C%20Chinese%20canteen%20lunch%2C%20food%20photography&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20tomato%20egg%20rice%20bowl%2C%20Chinese%20canteen%20lunch%2C%20food%20photography&image_size=square'), '["家常","午餐","酸甜"]', '<p>番茄酸甜开胃，鸡蛋软嫩，家常午餐选择。</p>', 18.00, 100, 0, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_P_T2_DN_001', 'MEAL_MOCK_MENU_P_T2_DN', @restaurant_id, @service_area_id, @template_dinner_id, 'MEAL_MOCK_TEMPLATE_ITEM_DN_004', 'dish', 'MEAL_MOCK_DISH_DN_003', NULL, '土豆烧牛腩', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20braised%20beef%20brisket%20with%20potatoes%2C%20dinner%20dish%2C%20food%20photo&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20braised%20beef%20brisket%20with%20potatoes%2C%20dinner%20dish%2C%20food%20photo&image_size=square'), '["炖菜","牛腩","晚餐"]', '<p>牛腩软烂、土豆绵糯，晚餐饱腹感强。</p>', 32.00, 80, 0, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_C_T0_BF_001', 'MEAL_MOCK_MENU_C_T0_BF', @restaurant_id, @service_area_id, @template_breakfast_id, 'MEAL_MOCK_TEMPLATE_ITEM_BF_001', 'dish', 'MEAL_MOCK_DISH_BF_001', NULL, '小米南瓜粥', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20millet%20pumpkin%20porridge%20in%20ceramic%20bowl%2C%20breakfast%20food%20photography&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20millet%20pumpkin%20porridge%20in%20ceramic%20bowl%2C%20breakfast%20food%20photography&image_size=square'), '["企业餐","暖胃","早餐"]', '<p>企业早餐可统一预订，支持员工餐配送。</p>', 8.00, 100, 3, 3, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_C_T0_LU_001', 'MEAL_MOCK_MENU_C_T0_LU', @restaurant_id, @service_area_id, @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_003', 'package', NULL, 'MEAL_MOCK_PACKAGE_001', '午餐双拼套餐', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20lunch%20set%20meal%20with%20braised%20chicken%2C%20vegetables%2C%20rice%20and%20soup&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20lunch%20set%20meal%20with%20braised%20chicken%2C%20vegetables%2C%20rice%20and%20soup&image_size=square'), '["企业餐","套餐","午餐"]', '<p>企业午餐标准套餐，适合团队集中配送。</p>', 38.00, 80, 12, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_C_T0_DN_001', 'MEAL_MOCK_MENU_C_T0_DN', @restaurant_id, @service_area_id, @template_dinner_id, 'MEAL_MOCK_TEMPLATE_ITEM_DN_002', 'dish', 'MEAL_MOCK_DISH_DN_002', NULL, '山西刀削面', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Shanxi%20knife%20cut%20noodles%20bowl%2C%20Chinese%20dinner%2C%20food%20photography&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Shanxi%20knife%20cut%20noodles%20bowl%2C%20Chinese%20dinner%2C%20food%20photography&image_size=square'), '["企业餐","面食","晚餐"]', '<p>企业晚餐面食选择，热汤热面配送到点。</p>', 20.00, 80, 10, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_C_T1_BF_001', 'MEAL_MOCK_MENU_C_T1_BF', @restaurant_id, @service_area_id, @template_breakfast_id, 'MEAL_MOCK_TEMPLATE_ITEM_BF_002', 'dish', 'MEAL_MOCK_DISH_BF_002', NULL, '鸡蛋蔬菜包', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20steamed%20Chinese%20vegetable%20buns%20with%20egg%2C%20breakfast%20plate%2C%20food%20photography&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20steamed%20Chinese%20vegetable%20buns%20with%20egg%2C%20breakfast%20plate%2C%20food%20photography&image_size=square'), '["企业餐","现蒸","早餐"]', '<p>适合企业员工明日早餐批量预订。</p>', 6.00, 120, 0, 5, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_C_T1_LU_001', 'MEAL_MOCK_MENU_C_T1_LU', @restaurant_id, @service_area_id, @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_003', 'package', NULL, 'MEAL_MOCK_PACKAGE_001', '午餐双拼套餐', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20lunch%20set%20meal%20with%20braised%20chicken%2C%20vegetables%2C%20rice%20and%20soup&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20lunch%20set%20meal%20with%20braised%20chicken%2C%20vegetables%2C%20rice%20and%20soup&image_size=square'), '["企业餐","荤素搭配","可预订"]', '<p>明日企业午餐套餐，荤素搭配更均衡。</p>', 38.00, 80, 0, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_C_T1_DN_001', 'MEAL_MOCK_MENU_C_T1_DN', @restaurant_id, @service_area_id, @template_dinner_id, 'MEAL_MOCK_TEMPLATE_ITEM_DN_003', 'package', NULL, 'MEAL_MOCK_PACKAGE_002', '晚餐轻食套餐', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20light%20dinner%20set%20with%20noodles%2C%20vegetables%20and%20yogurt%2C%20food%20photo&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20light%20dinner%20set%20with%20noodles%2C%20vegetables%20and%20yogurt%2C%20food%20photo&image_size=square'), '["企业餐","轻食","晚餐"]', '<p>企业晚餐轻食套餐，适合加班餐场景。</p>', 28.00, 80, 0, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_C_T2_BF_001', 'MEAL_MOCK_MENU_C_T2_BF', @restaurant_id, @service_area_id, @template_breakfast_id, 'MEAL_MOCK_TEMPLATE_ITEM_BF_003', 'dish', 'MEAL_MOCK_DISH_BF_003', NULL, '豆浆油条套餐', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20soy%20milk%20and%20fried%20dough%20sticks%20breakfast%2C%20clean%20table%2C%20food%20photo&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20soy%20milk%20and%20fried%20dough%20sticks%20breakfast%2C%20clean%20table%2C%20food%20photo&image_size=square'), '["企业餐","经典","早餐"]', '<p>企业后天早餐备选，经典组合接受度高。</p>', 10.00, 100, 0, 3, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_C_T2_LU_001', 'MEAL_MOCK_MENU_C_T2_LU', @restaurant_id, @service_area_id, @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_002', 'dish', 'MEAL_MOCK_DISH_LU_002', NULL, '汾州牛肉面', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20beef%20noodle%20soup%2C%20sliced%20beef%2C%20green%20onion%2C%20food%20photography&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20beef%20noodle%20soup%2C%20sliced%20beef%2C%20green%20onion%2C%20food%20photography&image_size=square'), '["企业餐","热汤","午餐"]', '<p>企业午餐热汤面，适合集中配送后尽快食用。</p>', 22.00, 100, 0, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_C_T2_DN_001', 'MEAL_MOCK_MENU_C_T2_DN', @restaurant_id, @service_area_id, @template_dinner_id, 'MEAL_MOCK_TEMPLATE_ITEM_DN_004', 'dish', 'MEAL_MOCK_DISH_DN_003', NULL, '土豆烧牛腩', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20braised%20beef%20brisket%20with%20potatoes%2C%20dinner%20dish%2C%20food%20photo&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20braised%20beef%20brisket%20with%20potatoes%2C%20dinner%20dish%2C%20food%20photo&image_size=square'), '["企业餐","炖菜","晚餐"]', '<p>企业晚餐炖菜，牛腩软烂，适合加餐补能量。</p>', 32.00, 80, 0, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ITEM_P2_T1_LU_001', 'MEAL_MOCK_MENU_P2_T1_LU', @restaurant_id, @service_area_id_2, @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_001', 'dish', 'MEAL_MOCK_DISH_LU_001', NULL, '杏花村黄焖鸡', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20braised%20chicken%20rice%20set%20meal%2C%20vegetables%2C%20restaurant%20food%20photo&image_size=square', JSON_ARRAY('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20braised%20chicken%20rice%20set%20meal%2C%20vegetables%2C%20restaurant%20food%20photo&image_size=square'), '["展馆配送","招牌","午餐"]', '<p>同一午餐模板发布到酒文化展馆配送服务区，验证模板可被多个独立服务区域引用。</p>', 28.00, 80, 0, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id);

-- 菜单明细规格
INSERT INTO biz_food_meal_menu_item_spec (
    id, menu_item_id, menu_id, restaurant_id, service_area_id, template_id, template_item_id, template_spec_id, spec_name, spec_description,
    sale_price, stock_quantity, sold_quantity, limit_quantity_per_user, sort_no,
    create_by, create_date, update_by, update_date, del_flag, remarks, tenant_code, tenant_id
) VALUES
('MEAL_MOCK_SPEC_P_T0_LU_001_A', 'MEAL_MOCK_ITEM_P_T0_LU_001', 'MEAL_MOCK_MENU_P_T0_LU', @restaurant_id, @service_area_id, @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_001', 'MEAL_MOCK_TEMPLATE_SPEC_LU_001_A', '一荤两素', '黄焖鸡+清炒时蔬+番茄鸡蛋', 28.00, 60, 18, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_SPEC_P_T0_LU_001_B', 'MEAL_MOCK_ITEM_P_T0_LU_001', 'MEAL_MOCK_MENU_P_T0_LU', @restaurant_id, @service_area_id, @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_001', 'MEAL_MOCK_TEMPLATE_SPEC_LU_001_B', '二荤一素', '黄焖鸡+土豆烧牛腩+清炒时蔬', 35.00, 40, 40, 2, 2, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_SPEC_P_T0_LU_002_A', 'MEAL_MOCK_ITEM_P_T0_LU_002', 'MEAL_MOCK_MENU_P_T0_LU', @restaurant_id, @service_area_id, @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_002', 'MEAL_MOCK_TEMPLATE_SPEC_LU_002_A', '标准份', '常规牛肉面份量', 22.00, 80, 20, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_SPEC_P_T0_LU_002_B', 'MEAL_MOCK_ITEM_P_T0_LU_002', 'MEAL_MOCK_MENU_P_T0_LU', @restaurant_id, @service_area_id, @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_002', 'MEAL_MOCK_TEMPLATE_SPEC_LU_002_B', '加量份', '加面加牛肉', 28.00, 40, 8, 1, 2, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_SPEC_P_T0_DN_002_A', 'MEAL_MOCK_ITEM_P_T0_DN_002', 'MEAL_MOCK_MENU_P_T0_DN', @restaurant_id, @service_area_id, @template_dinner_id, 'MEAL_MOCK_TEMPLATE_ITEM_DN_002', 'MEAL_MOCK_TEMPLATE_SPEC_DN_002_A', '标准份', '常规刀削面份量', 20.00, 60, 14, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_SPEC_P_T0_DN_002_B', 'MEAL_MOCK_ITEM_P_T0_DN_002', 'MEAL_MOCK_MENU_P_T0_DN', @restaurant_id, @service_area_id, @template_dinner_id, 'MEAL_MOCK_TEMPLATE_ITEM_DN_002', 'MEAL_MOCK_TEMPLATE_SPEC_DN_002_B', '加量份', '加面加卤', 25.00, 30, 6, 1, 2, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_SPEC_C_T0_LU_001_A', 'MEAL_MOCK_ITEM_C_T0_LU_001', 'MEAL_MOCK_MENU_C_T0_LU', @restaurant_id, @service_area_id, @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_003', 'MEAL_MOCK_TEMPLATE_SPEC_LU_003_A', '一荤两素', '黄焖鸡+清炒时蔬+番茄鸡蛋，企业标准餐', 38.00, 60, 12, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_SPEC_C_T0_LU_001_B', 'MEAL_MOCK_ITEM_C_T0_LU_001', 'MEAL_MOCK_MENU_C_T0_LU', @restaurant_id, @service_area_id, @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_003', 'MEAL_MOCK_TEMPLATE_SPEC_LU_003_B', '二荤一素', '黄焖鸡+土豆烧牛腩+清炒时蔬，企业加餐', 45.00, 50, 20, 2, 2, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_SPEC_C_T0_DN_001_A', 'MEAL_MOCK_ITEM_C_T0_DN_001', 'MEAL_MOCK_MENU_C_T0_DN', @restaurant_id, @service_area_id, @template_dinner_id, 'MEAL_MOCK_TEMPLATE_ITEM_DN_002', 'MEAL_MOCK_TEMPLATE_SPEC_DN_002_A', '标准份', '企业晚餐标准份', 20.00, 70, 10, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_SPEC_C_T0_DN_001_B', 'MEAL_MOCK_ITEM_C_T0_DN_001', 'MEAL_MOCK_MENU_C_T0_DN', @restaurant_id, @service_area_id, @template_dinner_id, 'MEAL_MOCK_TEMPLATE_ITEM_DN_002', 'MEAL_MOCK_TEMPLATE_SPEC_DN_002_B', '加量份', '企业晚餐加量份', 25.00, 40, 5, 1, 2, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_SPEC_P2_T1_LU_001_A', 'MEAL_MOCK_ITEM_P2_T1_LU_001', 'MEAL_MOCK_MENU_P2_T1_LU', @restaurant_id, @service_area_id_2, @template_lunch_id, 'MEAL_MOCK_TEMPLATE_ITEM_LU_001', 'MEAL_MOCK_TEMPLATE_SPEC_LU_001_A', '一荤两素', '展馆服务区午餐标准份', 28.00, 50, 0, 2, 1, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id);

-- 示例订单，包含配送地址快照
INSERT INTO app_food_meal_order (
    id, order_no, trade_order_id, unified_order_id, trade_center_order_id, order_type,
    restaurant_id, restaurant_name, service_area_id, service_area_name, menu_id, menu_date, meal_type,
    member_id, member_name, member_phone, company_id, company_name, employee_id, total_amount, discount_amount,
    company_pay_amount, user_pay_amount, refund_amount, order_status, pay_status, pickup_code, pay_time, cancel_time,
    cancel_reason, refund_time, refund_apply_time, refund_reason, verify_time, verify_user_id, verify_user_name,
    delivery_type, address_id, receiver_name, receiver_mobile, province, province_code, city, city_code, district, district_code,
    detail_address, full_address, longitude, latitude, remark, ext_json,
    create_by, create_date, update_by, update_date, del_flag, remarks, tenant_code, tenant_id
) VALUES
('MEAL_MOCK_ORDER_P_PENDING_001', 'MEALMOCKPENDING001', NULL, NULL, NULL, 'personal', @restaurant_id, '杏花村员工餐厅', @service_area_id, @service_area_name, 'MEAL_MOCK_MENU_P_T0_LU', @today, 'lunch', @member_id, @member_name, @member_phone, NULL, NULL, NULL, 28.00, 0.00, 0.00, 28.00, 0.00, 'pending_pay', 'unpaid', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'delivery', @address_id, @member_name, @member_phone, '山西省', '140000', '吕梁市', '141100', '汾阳市', '141182', '杏花村镇游客中心东侧员工餐厅配送点', '山西省吕梁市汾阳市杏花村镇游客中心东侧员工餐厅配送点', 111.781000, 37.265000, '少放辣', '{"orderType":"personal","deliveryType":"delivery"}', 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ORDER_P_PAID_001', 'MEALMOCKPAID001', 'MEAL_MOCK_TRADE_P_PAID_001', 'MEAL_MOCK_UNIFIED_P_PAID_001', NULL, 'personal', @restaurant_id, '杏花村员工餐厅', @service_area_id, @service_area_name, 'MEAL_MOCK_MENU_P_T0_BF', @today, 'breakfast', @member_id, @member_name, @member_phone, NULL, NULL, NULL, 14.00, 0.00, 0.00, 14.00, 0.00, 'paid', 'paid', 'P1001', DATE_SUB(NOW(), INTERVAL 1 HOUR), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'delivery', @address_id, @member_name, @member_phone, '山西省', '140000', '吕梁市', '141100', '汾阳市', '141182', '杏花村镇游客中心东侧员工餐厅配送点', '山西省吕梁市汾阳市杏花村镇游客中心东侧员工餐厅配送点', 111.781000, 37.265000, '早餐尽快配送', '{"orderType":"personal","deliveryType":"delivery"}', 'meal_mock', DATE_SUB(NOW(), INTERVAL 2 HOUR), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ORDER_C_PAID_001', 'MEALMOCKCPAID001', 'MEAL_MOCK_TRADE_C_PAID_001', 'MEAL_MOCK_UNIFIED_C_PAID_001', NULL, 'company', @restaurant_id, '杏花村员工餐厅', @service_area_id, @service_area_name, 'MEAL_MOCK_MENU_C_T0_LU', @today, 'lunch', @member_id, @member_name, @member_phone, @company_id, '杏花村文旅示范企业', @employee_id, 38.00, 0.00, 15.00, 23.00, 0.00, 'paid', 'paid', 'C1001', DATE_SUB(NOW(), INTERVAL 30 MINUTE), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'delivery', @address_id, @member_name, @member_phone, '山西省', '140000', '吕梁市', '141100', '汾阳市', '141182', '杏花村镇游客中心东侧员工餐厅配送点', '山西省吕梁市汾阳市杏花村镇游客中心东侧员工餐厅配送点', 111.781000, 37.265000, '午餐配送到前台', '{"orderType":"company","deliveryType":"delivery"}', 'meal_mock', DATE_SUB(NOW(), INTERVAL 1 HOUR), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ORDER_C_PICKED_001', 'MEALMOCKCPICKED001', 'MEAL_MOCK_TRADE_C_PICKED_001', 'MEAL_MOCK_UNIFIED_C_PICKED_001', NULL, 'company', @restaurant_id, '杏花村员工餐厅', @service_area_id, @service_area_name, 'MEAL_MOCK_MENU_C_T0_DN', @today, 'dinner', @member_id, @member_name, @member_phone, @company_id, '杏花村文旅示范企业', @employee_id, 20.00, 4.00, 0.00, 16.00, 0.00, 'picked', 'paid', 'C1002', DATE_SUB(NOW(), INTERVAL 3 HOUR), NULL, NULL, NULL, NULL, NULL, DATE_SUB(NOW(), INTERVAL 1 HOUR), 'meal_mock', '模拟核销员', 'delivery', @address_id, @member_name, @member_phone, '山西省', '140000', '吕梁市', '141100', '汾阳市', '141182', '杏花村镇游客中心东侧员工餐厅配送点', '山西省吕梁市汾阳市杏花村镇游客中心东侧员工餐厅配送点', 111.781000, 37.265000, '已配送完成', '{"orderType":"company","deliveryType":"delivery"}', 'meal_mock', DATE_SUB(NOW(), INTERVAL 4 HOUR), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id);

INSERT INTO app_food_meal_order_item (
    id, order_id, order_no, menu_item_id, menu_id, item_type, dish_id, package_id, item_name, item_image,
    spec_id, spec_name, spec_description,
    sale_price, quantity, total_amount, discount_amount, company_pay_amount, user_pay_amount, refund_quantity, refund_amount,
    create_by, create_date, update_by, update_date, del_flag, remarks, tenant_code, tenant_id
) VALUES
('MEAL_MOCK_ORDER_ITEM_P_PENDING_001', 'MEAL_MOCK_ORDER_P_PENDING_001', 'MEALMOCKPENDING001', 'MEAL_MOCK_ITEM_P_T0_LU_001', 'MEAL_MOCK_MENU_P_T0_LU', 'dish', 'MEAL_MOCK_DISH_LU_001', NULL, '杏花村黄焖鸡', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20braised%20chicken%20rice%20set%20meal%2C%20vegetables%2C%20restaurant%20food%20photo&image_size=square', 'MEAL_MOCK_SPEC_P_T0_LU_001_A', '一荤两素', '黄焖鸡+清炒时蔬+番茄鸡蛋', 28.00, 1, 28.00, 0.00, 0.00, 28.00, 0, 0.00, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ORDER_ITEM_P_PAID_001', 'MEAL_MOCK_ORDER_P_PAID_001', 'MEALMOCKPAID001', 'MEAL_MOCK_ITEM_P_T0_BF_001', 'MEAL_MOCK_MENU_P_T0_BF', 'dish', 'MEAL_MOCK_DISH_BF_001', NULL, '小米南瓜粥', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20millet%20pumpkin%20porridge%20in%20ceramic%20bowl%2C%20breakfast%20food%20photography&image_size=square', NULL, NULL, NULL, 8.00, 1, 8.00, 0.00, 0.00, 8.00, 0, 0.00, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ORDER_ITEM_P_PAID_002', 'MEAL_MOCK_ORDER_P_PAID_001', 'MEALMOCKPAID001', 'MEAL_MOCK_ITEM_P_T0_BF_002', 'MEAL_MOCK_MENU_P_T0_BF', 'dish', 'MEAL_MOCK_DISH_BF_002', NULL, '鸡蛋蔬菜包', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20steamed%20Chinese%20vegetable%20buns%20with%20egg%2C%20breakfast%20plate%2C%20food%20photography&image_size=square', NULL, NULL, NULL, 6.00, 1, 6.00, 0.00, 0.00, 6.00, 0, 0.00, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ORDER_ITEM_C_PAID_001', 'MEAL_MOCK_ORDER_C_PAID_001', 'MEALMOCKCPAID001', 'MEAL_MOCK_ITEM_C_T0_LU_001', 'MEAL_MOCK_MENU_C_T0_LU', 'package', NULL, 'MEAL_MOCK_PACKAGE_001', '午餐双拼套餐', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Chinese%20lunch%20set%20meal%20with%20braised%20chicken%2C%20vegetables%2C%20rice%20and%20soup&image_size=square', 'MEAL_MOCK_SPEC_C_T0_LU_001_A', '一荤两素', '黄焖鸡+清炒时蔬+番茄鸡蛋，企业标准餐', 38.00, 1, 38.00, 0.00, 15.00, 23.00, 0, 0.00, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ORDER_ITEM_C_PICKED_001', 'MEAL_MOCK_ORDER_C_PICKED_001', 'MEALMOCKCPICKED001', 'MEAL_MOCK_ITEM_C_T0_DN_001', 'MEAL_MOCK_MENU_C_T0_DN', 'dish', 'MEAL_MOCK_DISH_DN_002', NULL, '山西刀削面', 'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=realistic%20Shanxi%20knife%20cut%20noodles%20bowl%2C%20Chinese%20dinner%2C%20food%20photography&image_size=square', 'MEAL_MOCK_SPEC_C_T0_DN_001_A', '标准份', '企业晚餐标准份', 20.00, 1, 20.00, 4.00, 0.00, 16.00, 0, 0.00, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id);

-- 企业充值、流水、补贴使用记录
INSERT INTO biz_food_company_recharge (
    id, recharge_no, company_id, account_id, recharge_amount, recharge_channel, pay_order_id, pay_order_no,
    status, apply_time, paid_time, confirm_by, confirm_time, cancel_time,
    create_by, create_date, update_by, update_date, del_flag, remarks, tenant_code, tenant_id
) VALUES (
    'MEAL_MOCK_RECHARGE_001', 'MEALMOCKRECHARGE001', @company_id, @account_id, 5000.00, 'OFFLINE', NULL, NULL,
    2, DATE_SUB(NOW(), INTERVAL 1 DAY), DATE_SUB(NOW(), INTERVAL 1 DAY), 'meal_mock', DATE_SUB(NOW(), INTERVAL 1 DAY), NULL,
    'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id
);

INSERT INTO biz_food_company_account_log (
    id, account_id, company_id, change_type, change_amount, before_available_balance, after_available_balance,
    before_frozen_balance, after_frozen_balance, biz_type, biz_id, biz_no, operate_source, operator_id, operator_name,
    create_by, create_date, update_by, update_date, del_flag, remarks, tenant_code, tenant_id
) VALUES
('MEAL_MOCK_ACCOUNT_LOG_RECHARGE_001', @account_id, @company_id, 'RECHARGE', 5000.00, 0.00, 5000.00, 0.00, 0.00, 'RECHARGE', 'MEAL_MOCK_RECHARGE_001', 'MEALMOCKRECHARGE001', 'ADMIN', 'meal_mock', '模拟管理员', 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ACCOUNT_LOG_CONSUME_001', @account_id, @company_id, 'CONSUME', 15.00, 5000.00, 4985.00, 15.00, 0.00, 'MEAL_ORDER', 'MEAL_MOCK_ORDER_C_PAID_001', 'MEALMOCKCPAID001', 'MINI', @member_id, @member_name, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_ACCOUNT_LOG_CONSUME_002', @account_id, @company_id, 'CONSUME', 0.00, 4985.00, 4985.00, 0.00, 0.00, 'MEAL_ORDER', 'MEAL_MOCK_ORDER_C_PICKED_001', 'MEALMOCKCPICKED001', 'MINI', @member_id, @member_name, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id);

INSERT INTO biz_food_company_subsidy_use (
    id, company_id, employee_id, member_id, rule_id, order_id, order_no, meal_date, meal_type,
    original_amount, discount_amount, payable_amount, subsidy_amount, employee_pay_amount, status,
    frozen_time, used_time, cancel_time, refund_time,
    create_by, create_date, update_by, update_date, del_flag, remarks, tenant_code, tenant_id
) VALUES
('MEAL_MOCK_SUBSIDY_USE_C_PAID_001', @company_id, @employee_id, @member_id, 'MEAL_MOCK_SUBSIDY_LUNCH', 'MEAL_MOCK_ORDER_C_PAID_001', 'MEALMOCKCPAID001', @today, 'lunch', 38.00, 0.00, 38.00, 15.00, 23.00, 1, DATE_SUB(NOW(), INTERVAL 1 HOUR), DATE_SUB(NOW(), INTERVAL 30 MINUTE), NULL, NULL, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id),
('MEAL_MOCK_SUBSIDY_USE_C_PICKED_001', @company_id, @employee_id, @member_id, 'MEAL_MOCK_DISCOUNT_DINNER', 'MEAL_MOCK_ORDER_C_PICKED_001', 'MEALMOCKCPICKED001', @today, 'dinner', 20.00, 4.00, 16.00, 0.00, 16.00, 1, DATE_SUB(NOW(), INTERVAL 4 HOUR), DATE_SUB(NOW(), INTERVAL 1 HOUR), NULL, NULL, 'meal_mock', NOW(), 'meal_mock', NOW(), '0', '订餐模拟数据', @tenant_code, @tenant_id);

-- 快速校验
SELECT 'biz_food_restaurant' AS table_name, COUNT(*) AS mock_count FROM biz_food_restaurant WHERE id LIKE 'MEAL_MOCK_%'
UNION ALL
SELECT 'biz_food_dish', COUNT(*) FROM biz_food_dish WHERE id LIKE 'MEAL_MOCK_%'
UNION ALL
SELECT 'biz_food_package', COUNT(*) FROM biz_food_package WHERE id LIKE 'MEAL_MOCK_%'
UNION ALL
SELECT 'biz_food_meal_rule', COUNT(*) FROM biz_food_meal_rule WHERE id LIKE 'MEAL_MOCK_%'
UNION ALL
SELECT 'biz_food_meal_service_area', COUNT(*) FROM biz_food_meal_service_area WHERE id LIKE 'MEAL_MOCK_%'
UNION ALL
SELECT 'biz_food_meal_menu_template', COUNT(*) FROM biz_food_meal_menu_template WHERE id LIKE 'MEAL_MOCK_%'
UNION ALL
SELECT 'biz_food_meal_menu_template_item', COUNT(*) FROM biz_food_meal_menu_template_item WHERE id LIKE 'MEAL_MOCK_%'
UNION ALL
SELECT 'biz_food_meal_menu_template_item_spec', COUNT(*) FROM biz_food_meal_menu_template_item_spec WHERE id LIKE 'MEAL_MOCK_%'
UNION ALL
SELECT 'biz_food_company', COUNT(*) FROM biz_food_company WHERE id LIKE 'MEAL_MOCK_%'
UNION ALL
SELECT 'biz_food_company_employee', COUNT(*) FROM biz_food_company_employee WHERE id LIKE 'MEAL_MOCK_%'
UNION ALL
SELECT 'biz_food_company_join_apply', COUNT(*) FROM biz_food_company_join_apply WHERE id LIKE 'MEAL_MOCK_%'
UNION ALL
SELECT 'biz_food_company_account', COUNT(*) FROM biz_food_company_account WHERE id LIKE 'MEAL_MOCK_%'
UNION ALL
SELECT 'biz_food_company_subsidy_rule', COUNT(*) FROM biz_food_company_subsidy_rule WHERE id LIKE 'MEAL_MOCK_%'
UNION ALL
SELECT 'biz_food_meal_menu', COUNT(*) FROM biz_food_meal_menu WHERE id LIKE 'MEAL_MOCK_%'
UNION ALL
SELECT 'biz_food_meal_menu_item', COUNT(*) FROM biz_food_meal_menu_item WHERE id LIKE 'MEAL_MOCK_%'
UNION ALL
SELECT 'biz_food_meal_menu_item_spec', COUNT(*) FROM biz_food_meal_menu_item_spec WHERE id LIKE 'MEAL_MOCK_%'
UNION ALL
SELECT 'app_food_meal_order', COUNT(*) FROM app_food_meal_order WHERE id LIKE 'MEAL_MOCK_%'
UNION ALL
SELECT 'app_food_meal_order_item', COUNT(*) FROM app_food_meal_order_item WHERE id LIKE 'MEAL_MOCK_%'
UNION ALL
SELECT 'biz_food_company_recharge', COUNT(*) FROM biz_food_company_recharge WHERE id LIKE 'MEAL_MOCK_%'
UNION ALL
SELECT 'biz_food_company_account_log', COUNT(*) FROM biz_food_company_account_log WHERE id LIKE 'MEAL_MOCK_%'
UNION ALL
SELECT 'biz_food_company_subsidy_use', COUNT(*) FROM biz_food_company_subsidy_use WHERE id LIKE 'MEAL_MOCK_%';

SELECT name AS restaurant_name FROM biz_food_restaurant WHERE id = 'MEAL_MOCK_RESTAURANT_001';
SELECT area_name AS service_area_name FROM biz_food_meal_service_area WHERE id LIKE 'MEAL_MOCK_SERVICE_AREA_%' ORDER BY sort_no;
SELECT template_id, COUNT(DISTINCT service_area_id) AS service_area_count FROM biz_food_meal_menu WHERE id LIKE 'MEAL_MOCK_MENU_%' GROUP BY template_id;
SELECT name AS dish_name FROM biz_food_dish WHERE id = 'MEAL_MOCK_DISH_BF_001';
SELECT company_name FROM biz_food_company WHERE id = 'MEAL_MOCK_COMPANY_001';
SELECT full_address FROM app_food_meal_order WHERE id = 'MEAL_MOCK_ORDER_P_PAID_001';
