-- PDA 组盘：是否强制录入 WMS 单号（与 GlobalConfigCode.PDA_PAKIN_ASN_REQUIRED 一致）
-- type=1 布尔；val=true/1=强制；val=false/0=允许仅扫物料或仅单号（二选一，与旧版行为一致）
INSERT INTO `sys_config` (`uuid`, `name`, `flag`, `type`, `val`, `content`, `status`, `deleted`, `tenant_id`, `create_by`, `create_time`, `update_by`, `update_time`, `memo`)
SELECT UPPER(UUID()), 'PDA组盘WMS单号必填', 'PDA_PAKIN_ASN_REQUIRED', 1, 'true',
       '组盘页是否必须录入WMS单号', 1, 0, 1, NULL, NOW(), NULL, NOW(), 'PDA matnrPalletising'
WHERE NOT EXISTS (SELECT 1 FROM `sys_config` WHERE `flag` = 'PDA_PAKIN_ASN_REQUIRED' AND (`deleted` = 0 OR `deleted` IS NULL));
