#
Junjie
23 小时以前 3372040097ad2c01aeb6fd6485e89f19bf81b316
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
SET @station_path_len_weight_percent = (
  SELECT COALESCE(MAX(REPLACE(TRIM(`value`), '%', '')), '50')
  FROM `sys_config`
  WHERE `code` = 'stationPathLenWeightPercent'
);
 
SET @station_path_cong_weight_percent = (
  SELECT COALESCE(MAX(REPLACE(TRIM(`value`), '%', '')), '50')
  FROM `sys_config`
  WHERE `code` = 'stationPathCongWeightPercent'
);
 
SET @station_path_pass_other_out_station_weight_percent = (
  SELECT COALESCE(MAX(REPLACE(TRIM(`value`), '%', '')), '100')
  FROM `sys_config`
  WHERE `code` = 'stationPathPassOtherOutStationWeightPercent'
);
 
SET @station_path_pass_other_out_station_force_skip = (
  SELECT COALESCE(MAX(TRIM(`value`)), '0')
  FROM `sys_config`
  WHERE `code` = 'stationPathPassOtherOutStationForceSkip'
);
 
UPDATE `asr_bas_station_path_profile`
SET `config_json` = JSON_SET(
  CASE
    WHEN `config_json` IS NULL OR TRIM(`config_json`) = '' THEN '{}'
    ELSE `config_json`
  END,
  '$.stationPathLenWeightPercent', CAST(@station_path_len_weight_percent AS DECIMAL(10,2)),
  '$.stationPathCongWeightPercent', CAST(@station_path_cong_weight_percent AS DECIMAL(10,2)),
  '$.stationPathPassOtherOutStationWeightPercent', CAST(@station_path_pass_other_out_station_weight_percent AS DECIMAL(10,2)),
  '$.stationPathPassOtherOutStationForceSkip',
  CASE
    WHEN LOWER(@station_path_pass_other_out_station_force_skip) IN ('1', 'true', 'yes', 'y', 'on') THEN TRUE
    ELSE FALSE
  END
)
WHERE `id` IS NOT NULL;
 
DELETE FROM `sys_config`
WHERE `code` IN (
  'stationPathLenWeightPercent',
  'stationPathCongWeightPercent',
  'stationPathPassOtherOutStationWeightPercent',
  'stationPathPassOtherOutStationForceSkip'
);