#
Junjie
1 天以前 a0d8732c1d698b25850c0949f7b8967333d67d21
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-- asr_bas_station 增加出库任务上限配置
-- 用途:按最终出库站限制堆垛机可同时放行的在途出库任务数
-- 适用数据库:MySQL
 
SET @current_db := DATABASE();
 
SET @out_task_limit_exists := (
  SELECT COUNT(1)
  FROM information_schema.COLUMNS
  WHERE TABLE_SCHEMA = @current_db
    AND TABLE_NAME = 'asr_bas_station'
    AND COLUMN_NAME = 'out_task_limit'
);
 
SET @add_out_task_limit_sql := IF(
  @out_task_limit_exists = 0,
  'ALTER TABLE asr_bas_station ADD COLUMN out_task_limit INT NULL COMMENT ''出库任务上限,<0或NULL表示不限制,0表示禁止新出库'' AFTER station_alias',
  'SELECT ''column out_task_limit already exists'' '
);
PREPARE stmt_out_task_limit FROM @add_out_task_limit_sql;
EXECUTE stmt_out_task_limit;
DEALLOCATE PREPARE stmt_out_task_limit;
 
SHOW COLUMNS FROM asr_bas_station LIKE 'out_task_limit';