feat: 新增仓储大类字典与费用项档案归仓SQL
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
-- 金蝶分录仓储大类(A102-2/A302-2/A103-1 分录拆分按费用项档案分类编码判定仓储大类,无名称关键字兜底)。
|
||||
-- ① 业务字典 fee_category 新增子项 A05 仓储;② 费用项档案仓储类费用项归入 A05(分类生效前提)。
|
||||
-- id 由 UUID_SHORT() 动态生成,幂等可重复执行。
|
||||
|
||||
-- ① 业务字典 fee_category 新增子项:A05 仓储
|
||||
INSERT INTO blade_dict_biz (id, tenant_id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted)
|
||||
SELECT UUID_SHORT(), '000000',
|
||||
(SELECT id FROM blade_dict_biz WHERE code = 'fee_category' AND dict_key = '-1' AND tenant_id = '000000' AND is_deleted = 0 LIMIT 1),
|
||||
'fee_category', 'A05', '仓储', 1, '金蝶分录仓储大类', 0, 1, 0
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM blade_dict_biz
|
||||
WHERE code = 'fee_category' AND dict_key = 'A05' AND tenant_id = '000000' AND is_deleted = 0
|
||||
);
|
||||
|
||||
# -- ② 费用项档案:仓储类费用项归入 A05(已执行则更新 0 行,幂等)
|
||||
# UPDATE blade_fee_item
|
||||
# SET fee_category = 'A05'
|
||||
# WHERE is_deleted = 0
|
||||
# AND fee_category <> 'A05'
|
||||
# AND (name LIKE '%仓储%' OR name LIKE '%堆存%' OR name LIKE '%保管%');
|
||||
Reference in New Issue
Block a user