CREATE TABLE `dic` (
`id` bigint(32) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL COMMENT '字典描述名',
`description` varchar(255) DEFAULT NULL COMMENT '字典描述',
`dic_key` varchar(255) DEFAULT NULL COMMENT '字典key(惟一标识)',
`system_code` varchar(255) DEFAULT NULL COMMENT '字典类型码',
`delete_flag` int(2) DEFAULT '0' COMMENT '0=未删除,1= 已删除, 0为有效(default)',
`create_user_id` varchar(32) DEFAULT NULL,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_user_id` varchar(32) DEFAULT NULL,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`struct` varchar(255) DEFAULT NULL COMMENT '结构层级',
`flag` int(10) DEFAULT '0' COMMENT '是否可配置,0-可配置 1-不可配置',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `dic_item` (
`id` bigint(32) NOT NULL AUTO_INCREMENT,
`dic_item_key` varchar(255) DEFAULT NULL COMMENT '字典数据KEY',
`dic_item_value` varchar(255) DEFAULT NULL COMMENT '字典数据value',
`comment` varchar(255) DEFAULT NULL COMMENT '备注',
`dic_key` varchar(255) DEFAULT NULL COMMENT '字典key(惟一标识)',
`delete_flag` int(2) DEFAULT '0' COMMENT '0=未删除,1= 已删除, 0为有效(default)',
`create_user_id` varchar(32) DEFAULT NULL,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_user_id` varchar(32) DEFAULT NULL,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`code` varchar(255) DEFAULT NULL COMMENT 'code码',
`parent_code` varchar(255) DEFAULT NULL COMMENT '父code码',
`levels` int(10) DEFAULT '1' COMMENT '等级',
`rent_tenant_id` varchar(50) DEFAULT NULL COMMENT '租赁公司租户id',
`enterprise_tenant_id` varchar(50) DEFAULT NULL COMMENT '资产管理公司租户id',
PRIMARY KEY (`id`),
UNIQUE KEY `enterid_dicitemvalue` (`dic_item_value`,`enterprise_tenant_id`,`dic_key`)
) ENGINE=InnoDB AUTO_INCREMENT=115 DEFAULT CHARSET=utf8;