数据库设计 - Java开发企业级权限管理系统
Posted 民院小青年
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了数据库设计 - Java开发企业级权限管理系统相关的知识,希望对你有一定的参考价值。
1、表设计图
2、表关系
3、数据库sql语句
-- ---------------------------- -- Table structure for `sys_acl` -- ---------------------------- DROP TABLE IF EXISTS `sys_acl`; CREATE TABLE `sys_acl` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT \'权限id\', `code` varchar(20) NOT NULL DEFAULT \'\' COMMENT \'权限码\', `name` varchar(20) NOT NULL DEFAULT \'\' COMMENT \'权限名称\', `acl_module_id` int(11) NOT NULL DEFAULT \'0\' COMMENT \'权限所在的权限模块id\', `url` varchar(100) NOT NULL DEFAULT \'\' COMMENT \'请求的url, 可以填正则表达式\', `type` int(11) NOT NULL DEFAULT \'3\' COMMENT \'类型,1:菜单,2:按钮,3:其他\', `status` int(11) NOT NULL DEFAULT \'1\' COMMENT \'状态,1:正常,0:冻结\', `seq` int(11) NOT NULL DEFAULT \'0\' COMMENT \'权限在当前模块下的顺序,由小到大\', `remark` varchar(200) DEFAULT \'\' COMMENT \'备注\', `operator` varchar(20) NOT NULL DEFAULT \'\' COMMENT \'操作者\', `operate_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT \'最后一次更新时间\', `operate_ip` varchar(20) NOT NULL DEFAULT \'\' COMMENT \'最后一个更新者的ip地址\', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4; -- ---------------------------- -- Records of `sys_acl` -- ---------------------------- BEGIN; INSERT INTO `sys_acl` VALUES (\'1\', \'20171015095130_26\', \'进入产品管理界面\', \'1\', \'/sys/product/product.page\', \'1\', \'1\', \'1\', \'\', \'Admin\', \'2017-10-15 09:51:30\', \'0:0:0:0:0:0:0:1\'), (\'2\', \'20171015095322_14\', \'查询产品列表\', \'1\', \'/sys/product/page.json\', \'2\', \'1\', \'2\', \'\', \'Admin\', \'2017-10-15 09:53:22\', \'0:0:0:0:0:0:0:1\'), (\'3\', \'20171015095350_69\', \'产品上架\', \'1\', \'/sys/product/online.json\', \'2\', \'1\', \'3\', \'\', \'Admin\', \'2017-10-15 09:53:51\', \'0:0:0:0:0:0:0:1\'), (\'4\', \'20171015095420_7\', \'产品下架\', \'1\', \'/sys/product/offline.json\', \'2\', \'1\', \'4\', \'\', \'Admin\', \'2017-10-15 10:11:28\', \'0:0:0:0:0:0:0:1\'), (\'5\', \'20171015212626_63\', \'进入订单页\', \'2\', \'/sys/order/order.page\', \'1\', \'1\', \'1\', \'\', \'Admin\', \'2017-10-15 21:26:27\', \'0:0:0:0:0:0:0:1\'), (\'6\', \'20171015212657_12\', \'查询订单列表\', \'2\', \'/sys/order/list.json\', \'2\', \'1\', \'2\', \'\', \'Admin\', \'2017-10-15 21:26:57\', \'0:0:0:0:0:0:0:1\'), (\'7\', \'20171015212907_36\', \'进入权限管理页\', \'7\', \'/sys/aclModule/acl.page\', \'1\', \'1\', \'1\', \'\', \'Admin\', \'2017-10-15 21:29:07\', \'0:0:0:0:0:0:0:1\'), (\'8\', \'20171015212938_27\', \'进入角色管理页\', \'8\', \'/sys/role/role.page\', \'1\', \'1\', \'1\', \'\', \'Admin\', \'2017-10-16 17:49:38\', \'0:0:0:0:0:0:0:1\'), (\'9\', \'20171015213009_0\', \'进入用户管理页\', \'9\', \'/sys/dept/dept.page\', \'1\', \'1\', \'1\', \'\', \'Admin\', \'2017-10-15 21:30:09\', \'0:0:0:0:0:0:0:1\'), (\'10\', \'20171016230429_8\', \'进入权限更新记录页面\', \'11\', \'/sys/log/log.page\', \'1\', \'1\', \'1\', \'\', \'Admin\', \'2017-10-16 23:04:49\', \'0:0:0:0:0:0:0:1\'); COMMIT; -- ---------------------------- -- Table structure for `sys_acl_module` -- ---------------------------- DROP TABLE IF EXISTS `sys_acl_module`; CREATE TABLE `sys_acl_module` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT \'权限模块id\', `name` varchar(20) NOT NULL DEFAULT \'\' COMMENT \'权限模块名称\', `parent_id` int(11) NOT NULL DEFAULT \'0\' COMMENT \'上级权限模块id\', `level` varchar(200) NOT NULL DEFAULT \'\' COMMENT \'权限模块层级\', `seq` int(11) NOT NULL DEFAULT \'0\' COMMENT \'权限模块在当前层级下的顺序,由小到大\', `status` int(11) NOT NULL DEFAULT \'1\' COMMENT \'状态,1:正常,0:冻结\', `remark` varchar(200) DEFAULT \'\' COMMENT \'备注\', `operator` varchar(20) NOT NULL DEFAULT \'\' COMMENT \'操作者\', `operate_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT \'最后一次操作时间\', `operate_ip` varchar(20) NOT NULL DEFAULT \'\' COMMENT \'最后一次更新操作者的ip地址\', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- ---------------------------- -- Records of `sys_acl_module` -- ---------------------------- BEGIN; INSERT INTO `sys_acl_module` VALUES (\'1\', \'产品管理\', \'0\', \'0\', \'1\', \'1\', \'product\', \'Admin\', \'2017-10-14 21:13:15\', \'0:0:0:0:0:0:0:1\'), (\'2\', \'订单管理\', \'0\', \'0\', \'2\', \'1\', \'\', \'Admin\', \'2017-10-14 20:17:11\', \'0:0:0:0:0:0:0:1\'), (\'3\', \'公告管理\', \'0\', \'0\', \'3\', \'1\', \'\', \'Admin\', \'2017-10-14 20:17:21\', \'0:0:0:0:0:0:0:1\'), (\'4\', \'出售中产品管理\', \'1\', \'0.1\', \'1\', \'1\', \'\', \'Admin\', \'2017-10-14 21:13:39\', \'0:0:0:0:0:0:0:1\'), (\'5\', \'下架产品管理\', \'1\', \'0.1\', \'2\', \'1\', \'\', \'Admin\', \'2017-10-14 20:18:02\', \'0:0:0:0:0:0:0:1\'), (\'6\', \'权限管理\', \'0\', \'0\', \'4\', \'1\', \'\', \'Admin\', \'2017-10-15 21:27:37\', \'0:0:0:0:0:0:0:1\'), (\'7\', \'权限管理\', \'6\', \'0.6\', \'1\', \'1\', \'\', \'Admin\', \'2017-10-15 21:27:57\', \'0:0:0:0:0:0:0:1\'), (\'8\', \'角色管理\', \'6\', \'0.6\', \'2\', \'1\', \'\', \'Admin\', \'2017-10-15 21:28:22\', \'0:0:0:0:0:0:0:1\'), (\'9\', \'用户管理\', \'6\', \'0.6\', \'2\', \'1\', \'\', \'Admin\', \'2017-10-15 21:28:36\', \'0:0:0:0:0:0:0:1\'), (\'10\', \'运维管理\', \'0\', \'0\', \'6\', \'1\', \'\', \'Admin\', \'2017-10-16 23:03:37\', \'0:0:0:0:0:0:0:1\'), (\'11\', \'权限更新记录管理\', \'6\', \'0.6\', \'4\', \'1\', \'\', \'Admin\', \'2017-10-16 23:04:07\', \'0:0:0:0:0:0:0:1\'); COMMIT; -- ---------------------------- -- Table structure for `sys_dept` -- ---------------------------- DROP TABLE IF EXISTS `sys_dept`; CREATE TABLE `sys_dept` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT \'部门id\', `name` varchar(20) NOT NULL DEFAULT \'\' COMMENT \'部门名称\', `parent_id` int(11) NOT NULL DEFAULT \'0\' COMMENT \'上级部门id\', `level` varchar(200) NOT NULL DEFAULT \'\' COMMENT \'部门层级\', `seq` int(11) NOT NULL DEFAULT \'0\' COMMENT \'部门在当前层级下的顺序,由小到大\', `remark` varchar(200) DEFAULT \'\' COMMENT \'备注\', `operator` varchar(20) NOT NULL DEFAULT \'\' COMMENT \'操作者\', `operate_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT \'最后一次操作时间\', `operate_ip` varchar(20) NOT NULL DEFAULT \'\' COMMENT \'最后一次更新操作者的ip地址\', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4; -- ---------------------------- -- Records of `sys_dept` -- ---------------------------- BEGIN; INSERT INTO `sys_dept` VALUES (\'1\', \'技术部\', \'0\', \'0\', \'1\', \'技术部\', \'system\', \'2017-10-11 07:21:40\', \'127.0.0.1\'), (\'2\', \'后端开发\', \'1\', \'0.1\', \'1\', \'后端\', \'system-update\', \'2017-10-12 07:56:16\', \'127.0.0.1\'), (\'3\', \'前端开发\', \'1\', \'0.1\', \'2\', \'\', \'system-update\', \'2017-10-14 11:29:45\', \'127.0.0.1\'), (\'4\', \'UI设计\', \'1\', \'0.1\', \'3\', \'\', \'system\', \'2017-10-12 07:55:43\', \'127.0.0.1\'), (\'11\', \'产品部\', \'0\', \'0\', \'2\', \'\', \'Admin\', \'2017-10-16 22:52:29\', \'0:0:0:0:0:0:0:1\'), (\'12\', \'客服部\', \'0\', \'0\', \'4\', \'\', <以上是关于数据库设计 - Java开发企业级权限管理系统的主要内容,如果未能解决你的问题,请参考以下文章