UPDATE `la_dev_crontab`
SET
    `name` = '第三方赛事赔率抓取',
    `remark` = 'Docker crawler 每5分钟登录第三方线路并同步赛事赔率到 la_match_odds',
    `status` = 1,
    `expression` = '*/5 * * * *',
    `update_time` = UNIX_TIMESTAMP()
WHERE `command` = 'crawler'
  AND `params` = 'match_odds'
  AND `delete_time` IS NULL;

INSERT INTO `la_dev_crontab`
(`name`, `type`, `system`, `remark`, `command`, `params`, `status`, `expression`, `create_time`, `update_time`)
SELECT
    '第三方赛事赔率抓取',
    1,
    0,
    'Docker crawler 每5分钟登录第三方线路并同步赛事赔率到 la_match_odds',
    'crawler',
    'match_odds',
    1,
    '*/5 * * * *',
    UNIX_TIMESTAMP(),
    UNIX_TIMESTAMP()
WHERE NOT EXISTS (
    SELECT 1
    FROM `la_dev_crontab`
    WHERE `command` = 'crawler'
      AND `params` = 'match_odds'
      AND `delete_time` IS NULL
);
