-- 已有环境：将 track 检索改为自动模式（检索设备全部 track）
UPDATE `SYSTEM_DICT_DATA` dd
INNER JOIN `SYSTEM_DICT` d ON d.`ID` = dd.`DICT_ID` AND d.`CODE` = 'CS_PARAM' AND d.`DELETED` = 0
SET dd.`CODE` = 'auto', dd.`REMARK` = '媒体检索trackID，auto/空=自动从record/tracks获取全部'
WHERE dd.`LABEL` = 'CS_SEARCH_TRACK_ID' AND dd.`DELETED` = 0 AND dd.`CODE` = '101';

INSERT INTO `SYSTEM_DICT_DATA`(`DICT_ID`, `LABEL`, `CODE`, `REMARK`, `SORT`, `DISABLED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`)
SELECT d.`ID`, 'CS_FFMPEG_PATH', 'ffmpeg', 'FFmpeg可执行文件路径，用于采集站视频转码为浏览器可播MP4', 3, 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0
FROM `SYSTEM_DICT` d
WHERE d.`CODE` = 'CS_PARAM' AND d.`DELETED` = 0
AND NOT EXISTS (
  SELECT 1 FROM `SYSTEM_DICT_DATA` dd
  WHERE dd.`DICT_ID` = d.`ID` AND dd.`LABEL` = 'CS_FFMPEG_PATH' AND dd.`DELETED` = 0
);
