-- 为新增的posts添加互动事件数据
INSERT INTO
  events (
    user_id,
    influencer_id,
    content_id,
    project_id,
    event_type,
    funnel_stage,
    platform,
    content_type,
    content_status,
    sentiment,
    timestamp,
    date
  ) -- 为post_1_1添加事件数据（Twitter文本帖文）
SELECT
  concat('user_', toString(number % 500 + 1)),
  'influencer_1',
  'post_1_1',
  'project_3',
  multiIf(
    number % 10 < 5,
    'view',
    number % 10 < 7,
    'like',
    number % 10 < 8,
    'comment',
    number % 10 < 9,
    'share',
    'impression'
  ),
  multiIf(
    number % 10 < 3,
    'exposure',
    number % 10 < 6,
    'interest',
    number % 10 < 8,
    'consideration',
    'intent'
  ),
  'Twitter',
  'text',
  'approved',
  multiIf(
    number % 3 = 0,
    'positive',
    number % 3 = 1,
    'neutral',
    'negative'
  ),
  now() - INTERVAL (number % 48) HOUR,
  today() - INTERVAL (number % 2) DAY
FROM
  numbers(1, 350)
UNION
ALL -- 为post_2_1添加事件数据（TikTok视频帖文）
SELECT
  concat('user_', toString(number % 500 + 1)),
  'influencer_2',
  'post_2_1',
  'project_2',
  multiIf(
    number % 10 < 5,
    'view',
    number % 10 < 7,
    'like',
    number % 10 < 8,
    'comment',
    number % 10 < 9,
    'share',
    'impression'
  ),
  multiIf(
    number % 10 < 3,
    'exposure',
    number % 10 < 6,
    'interest',
    number % 10 < 8,
    'consideration',
    'intent'
  ),
  'TikTok',
  'video',
  'approved',
  multiIf(
    number % 3 = 0,
    'positive',
    number % 3 = 1,
    'neutral',
    'negative'
  ),
  now() - INTERVAL (number % 24) HOUR,
  today() - INTERVAL (number % 1) DAY
FROM
  numbers(1, 450)
UNION
ALL -- 为post_6_1添加事件数据（Instagram图片帖文）
SELECT
  concat('user_', toString(number % 500 + 1)),
  'influencer_6',
  'post_6_1',
  'project_3',
  multiIf(
    number % 10 < 5,
    'view',
    number % 10 < 7,
    'like',
    number % 10 < 8,
    'comment',
    number % 10 < 9,
    'share',
    'impression'
  ),
  multiIf(
    number % 10 < 3,
    'exposure',
    number % 10 < 6,
    'interest',
    number % 10 < 8,
    'consideration',
    'intent'
  ),
  'Instagram',
  'image',
  'approved',
  multiIf(
    number % 3 = 0,
    'positive',
    number % 3 = 1,
    'neutral',
    'negative'
  ),
  now() - INTERVAL (number % 24) HOUR,
  today() - INTERVAL (number % 1) DAY
FROM
  numbers(1, 400)
UNION
ALL -- 为post_9_1添加事件数据（TikTok视频帖文）
SELECT
  concat('user_', toString(number % 500 + 1)),
  'influencer_9',
  'post_9_1',
  'project_2',
  multiIf(
    number % 10 < 5,
    'view',
    number % 10 < 7,
    'like',
    number % 10 < 8,
    'comment',
    number % 10 < 9,
    'share',
    'impression'
  ),
  multiIf(
    number % 10 < 3,
    'exposure',
    number % 10 < 6,
    'interest',
    number % 10 < 8,
    'consideration',
    'intent'
  ),
  'TikTok',
  'video',
  'approved',
  multiIf(
    number % 3 = 0,
    'positive',
    number % 3 = 1,
    'neutral',
    'negative'
  ),
  now() - INTERVAL (number % 24) HOUR,
  today() - INTERVAL (number % 1) DAY
FROM
  numbers(1, 380)
UNION
ALL -- 为post_4_1添加事件数据（Facebook图片帖文）
SELECT
  concat('user_', toString(number % 500 + 1)),
  'influencer_4',
  'post_4_1',
  'project_2',
  multiIf(
    number % 10 < 5,
    'view',
    number % 10 < 7,
    'like',
    number % 10 < 8,
    'comment',
    number % 10 < 9,
    'share',
    'impression'
  ),
  multiIf(
    number % 10 < 3,
    'exposure',
    number % 10 < 6,
    'interest',
    number % 10 < 8,
    'consideration',
    'intent'
  ),
  'Facebook',
  'image',
  'approved',
  multiIf(
    number % 3 = 0,
    'positive',
    number % 3 = 1,
    'neutral',
    'negative'
  ),
  now() - INTERVAL (number % 96) HOUR,
  today() - INTERVAL (number % 4) DAY
FROM
  numbers(1, 320);