Files
MES/yawei-mes/.sql/2026-01-07_v1.0.68_周启威_领料单编码规则修改.sql
2026-04-02 10:39:03 +08:00

23 lines
1.3 KiB
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- =============================================
-- 领料单编码规则修改
-- 原格式SCLL + 6位流水号如 SCLL000659
-- 新格式SCLL + 8位日期 + 3位流水号如 SCLL20260107001
-- 不同日期流水号从001开始
-- =============================================
-- 删除旧的领料单编码规则子项
DELETE FROM sys_code_rule_entry WHERE rule_id = 10;
-- 插入新的编码规则子项
-- 第1项常量 SCLLsort=1
INSERT INTO sys_code_rule_entry (rule_id, sort, type_id, length_flow, max_flow, date_format, constant_char, element_source_table, source_attribute, source_value, code_cover, max_date)
VALUES (10, 1, 'B', 0, 0, '', 'SCLL', '', '', NULL, '', NULL);
-- 第2项日期 yyyyMMddsort=28位日期
INSERT INTO sys_code_rule_entry (rule_id, sort, type_id, length_flow, max_flow, date_format, constant_char, element_source_table, source_attribute, source_value, code_cover, max_date)
VALUES (10, 2, 'C', 0, 0, 'yyyyMMdd', '', '', '', NULL, '', NULL);
-- 第3项流水号sort=33位用0补位按日期重置从001开始
INSERT INTO sys_code_rule_entry (rule_id, sort, type_id, length_flow, max_flow, date_format, constant_char, element_source_table, source_attribute, source_value, code_cover, max_date)
VALUES (10, 3, 'A', 3, 1, '', '', '', '', NULL, '0', NULL);