数据库字典表设计,支撑多层字典表。
CREATE TABLE `sys_dict` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`pid` int(11) DEFAULT '0' COMMENT ' 父ID ',
`dataType` varchar(50) NOT NULL COMMENT ' 数据类别,首字母大写 ',
`dataCode` varchar(50) NOT NULL COMMENT ' 数据编码 ',
`dataValue` varchar(200) NOT NULL COMMENT ' 数据名称/值 ',
`sortNo` int(11) unsigned DEFAULT '1' COMMENT ' 顺序 ',
`status` tinyint(2) DEFAULT '0' COMMENT '0正常,1删除',
`isFixed` tinyint(2) DEFAULT '0' COMMENT '0默认为不固定,1固定',
`dataDesc` varchar(400) DEFAULT NULL COMMENT '数据描述',
`updateTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `SYS_DICT_PK` (`id`),
KEY `idx_dc_dt` (`dataType`,`dataCode`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COMMENT='系统字典表';