-- ----------------------------
--  Table structure for `dic_dt_type`
-- ----------------------------
CREATE TABLE IF NOT EXISTS `dic_dt_type` (
`id` varchar(40) NOT NULL,
`group_code` varchar(40) DEFAULT NULL COMMENT '集团编码',
`type` varchar(40) NOT NULL COMMENT '字典类型',
`name` varchar(200) NOT NULL COMMENT '字典类型名称',
`description` varchar(500) DEFAULT NULL COMMENT '描述',
`valid` int(1) DEFAULT NULL COMMENT '状态',
`remark` varchar(3000) DEFAULT NULL COMMENT '备注',
`creator` varchar(40) DEFAULT NULL,
`creation_time` char(14) DEFAULT NULL,
`modifier` varchar(40) DEFAULT NULL,
`modified_time` char(14) DEFAULT NULL,
`ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '乐观锁',
PRIMARY KEY (`id`),
KEY `index1` (`type`,`name`,`group_code`,`valid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字典类型';


-- ----------------------------
--  Table structure for `dic_dt_data`
-- ----------------------------
CREATE TABLE IF NOT EXISTS `dic_dt_data` (
`id` varchar(80) NOT NULL,
`dict_type_id` varchar(80) NOT NULL COMMENT '字典类型ID',
`parent_id` varchar(80) DEFAULT NULL COMMENT '父节点',
`type` varchar(80) NOT NULL COMMENT '字典类型',
`code` varchar(200) NOT NULL COMMENT '字典数据编码',
`label` varchar(200) NOT NULL COMMENT '字典数据标签',
`valid` int(11) NOT NULL DEFAULT '1' COMMENT '状态',
`creator` varchar(40) DEFAULT NULL COMMENT '创建用户',
`creation_time` char(14) DEFAULT NULL COMMENT '创建时间',
`modifier` varchar(40) DEFAULT NULL COMMENT '更新用户',
`modified_time` char(14) DEFAULT NULL COMMENT '更新时间',
`remark` varchar(200) DEFAULT NULL,
`order_num` int(11) DEFAULT NULL,
`ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '乐观锁',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字典数据';


-- ----------------------------
--  Table structure for `dic_dt_data_map`
-- ----------------------------
CREATE TABLE IF NOT EXISTS `dic_dt_data_map` (
`id` varchar(80) NOT NULL,
`dict_data_id` varchar(80) NOT NULL COMMENT '字典数据ID',
`type` varchar(40) NOT NULL COMMENT '字典类型',
`code` varchar(40) NOT NULL COMMENT '字典数据编码',
`group_code` varchar(11) NOT NULL COMMENT '集团编码',
`target_code` varchar(40) NOT NULL COMMENT '映射字典数据表code',
`label` varchar(40) NOT NULL COMMENT '字典数据标签',
`valid` int(11) NOT NULL DEFAULT '1' COMMENT '状态',
`creator` varchar(40) DEFAULT NULL COMMENT '创建用户',
`creation_time` char(14) DEFAULT NULL COMMENT '创建时间',
`modifier` varchar(40) DEFAULT NULL COMMENT '更新用户',
`modified_time` char(14) DEFAULT NULL COMMENT '更新时间',
`remark` varchar(200) DEFAULT NULL,
`order_num` int(11) DEFAULT NULL,
`ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '乐观锁',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字典数据映射表';

-- ----------------------------
--  Table structure for `dt_code_type`
-- ----------------------------
CREATE TABLE IF NOT EXISTS `dt_code_type` (
  `id` varchar(40) NOT NULL,
  `group_code` varchar(40) DEFAULT NULL,
  `project_id` varchar(40) NOT NULL,
  `code` varchar(40) DEFAULT NULL COMMENT '编码',
  `name` varchar(200) DEFAULT NULL COMMENT '名称',
  `extras` varchar(60) DEFAULT NULL COMMENT '扩展属性',
  `tree_flag` tinyint DEFAULT NULL COMMENT '树标识',
  `show_order` int(11) DEFAULT NULL COMMENT '显示顺序',
  `remark` varchar(1024) DEFAULT NULL COMMENT '备注',
  `creator` varchar(32) DEFAULT NULL COMMENT '创建人',
  `creation_time` char(14) NULL DEFAULT NULL COMMENT '创建时间',
  `modifier` varchar(32) DEFAULT NULL COMMENT '最后修改人',
  `modified_time` char(14) NULL DEFAULT NULL COMMENT '最后修改时间',
  `valid` tinyint DEFAULT NULL COMMENT '合法标识',
  `ts` timestamp default current_timestamp on update current_timestamp NOT NULL COMMENT '乐观锁',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='码表类型';

-- ----------------------------
--  Table structure for `dt_code_data`
-- ----------------------------
CREATE TABLE IF NOT EXISTS `dt_code_data`  (
  `id` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `group_code` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  `project_id` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `type_id` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '类型ID',
  `type_code` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '类型编码',
  `code` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '编码',
  `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '名称',
  `parent_id` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '上级ID',
  `inner_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  `extras` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '扩展属性',
  `show_order` int(0) NULL DEFAULT NULL COMMENT '显示顺序',
  `remark` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
  `creator` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人',
  `creation_time` char(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建时间',
  `modifier` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '最后修改人',
  `modified_time` char(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '最后修改时间',
  `valid` tinyint(0) NULL DEFAULT NULL COMMENT '合法标识',
  `ts` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '乐观锁',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '码表数据' ROW_FORMAT = Dynamic;
