-- ----------------------------
-- 部门表
-- ----------------------------
CREATE TABLE `hazmat_manage`.`sys_dept`  (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`parent_id` bigint NOT NULL DEFAULT 0 COMMENT '父部门id',
`ancestors` varchar(50) NULL DEFAULT '' COMMENT '祖级列表',
`name` varchar(30) NOT NULL COMMENT '部门名称',
`sort` int NULL DEFAULT 0 COMMENT '显示顺序',
`leader` varchar(20) NULL DEFAULT '' COMMENT '负责人',
`phone` varchar(11) NULL DEFAULT '' COMMENT '联系电话',
`email` varchar(50) NULL DEFAULT '' COMMENT '邮箱',
`status` tinyint NULL DEFAULT 0 COMMENT '部门状态(0正常 1停用 默认0) ',
`company_id` bigint NOT NULL COMMENT '企业id',
`del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0代表存在 1代表删除)',
`create_by` varchar(64) NULL DEFAULT '' COMMENT '创建者',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_by` varchar(64) NULL DEFAULT '',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`remark` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`)
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '部门表' ROW_FORMAT = Dynamic;


