所需表结构:
DROP TABLE IF EXISTS `encoder_sequence`;
CREATE TABLE `encoder_sequence` (
`seq_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '序列名称',
`current_val` int(11) NOT NULL COMMENT '当前值',
`increment_val` int(11) NOT NULL DEFAULT 1 COMMENT '自增值',
`prefix` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '前置参数',
`seqlength` int(10) NULL DEFAULT NULL COMMENT '序列长度',
`date_style` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '日期样式',
PRIMARY KEY (`seq_name`) USING BTREE,
INDEX `index_seq_name`(`seq_name`) USING BTREE,
INDEX `index_seq_name-1`(`seq_name`, `current_val`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;