学习之:http://www.cnblogs.com/kivenhou/archive/2009/10/19/1586106.html

此为模型图:

据此写了sql语句:

drop table if exists tb_Permit_Group;

drop table if exists tb_Position_Permit;

drop table if exists tb_Position_User;

drop table if exists tb_Project_User;

drop table if exists tb_Role_Permit;

drop table if exists tb_User_Permit;

drop table if exists tb_User;

 

drop table if exists tb_Permit;

drop table if exists tb_Action;

 

drop table if exists tb_Position;

drop table if exists tb_Department;

drop table if exists tb_Company;

 

drop table if exists tb_Module;

 

drop table if exists tb_Project;

 

drop table if exists tb_Role;

 

 

/*==============================================================*/

/* Table: tb_Action                                             */

/*==============================================================*/

create table tb_Action

(

   ActionCode           varchar(20) not null,

   ActionName           varchar(20),

   ActionValue          varchar(20),

   primary key (ActionCode)

);

 

/*==============================================================*/

/* Table: tb_Company                                            */

/*==============================================================*/

create table tb_Company

(

   CompanyCode          varchar(20) not null,

   CompanyName          varchar(20),

   primary key (CompanyCode)

);

 

/*==============================================================*/

/* Table: tb_Department                                         */

/*==============================================================*/

create table tb_Department

(

   DeptCode             varchar(20) not null,

   DeptName             varchar(20),

   ParentDepartment     varchar(20),

   DepartmentDescription varchar(256),

   CompanyCode          varchar(20),

   primary key (DeptCode)

);

 

/*==============================================================*/

/* Table: tb_Module                                             */

/*==============================================================*/

create table tb_Module

(

   ModuleCode           varchar(20) not null,

   ModuleName           varchar(20),

   ModuleValue          varchar(20),

   LinkUrl              varchar(256),

   ParentModule         varchar(20),

   ModuleDescription    varchar(256),

   primary key (ModuleCode)

);

 

/*==============================================================*/

/* Table: tb_Permit                                             */

/*==============================================================*/

create table tb_Permit

(

   PermitCode           varchar(100) not null,

   ModuleCode           varchar(20),

   ActionCode           varchar(20),

   PermitValue          varchar(20),

   primary key (PermitCode)

);

 

/*==============================================================*/

/* Table: tb_Permit_Group                                       */

/*==============================================================*/

create table tb_Permit_Group

(

   GroupCode            varchar(20) not null,

   GroupName            varchar(20),

   PermitCode           varchar(100),

   primary key (GroupCode)

);

 

/*==============================================================*/

/* Table: tb_Position                                           */

/*==============================================================*/

create table tb_Position

(

   PositionCode         varchar(100) not null,

   PositionName         varchar(20),

   PositionDescription  varchar(256),

   ParentPosition       varchar(20),

   DeptCode             varchar(20),

   primary key (PositionCode)

);

 

/*==============================================================*/

/* Table: tb_Position_Permit                                    */

/*==============================================================*/

create table tb_Position_Permit

(

   PositionCode         varchar(100) not null,

   PermitCode           varchar(100),

   primary key (PositionCode)

);

 

/*==============================================================*/

/* Table: tb_Position_User                                      */

/*==============================================================*/

create table tb_Position_User

(

   PositionCode         varchar(100),

   UserId               varchar(20)

);

 

/*==============================================================*/

/* Table: tb_Project                                            */

/*==============================================================*/

create table tb_Project

(

   ProjectCode          varchar(20) not null,

   ProjectName          varchar(20),

   ParentProject        varchar(20),

   ProjectDescription   varchar(256),

   primary key (ProjectCode)

);

 

/*==============================================================*/

/* Table: tb_Project_User                                       */

/*==============================================================*/

create table tb_Project_User

(

   ProjectCode          varchar(20),

   UserId               varchar(20),

   IsLead               int

);

 

/*==============================================================*/

/* Table: tb_Role                                               */

/*==============================================================*/

create table tb_Role

(

   RoleCode             varchar(100) not null,

   RoleName             varchar(20),

   RoleDescription      varchar(256),

   primary key (RoleCode)

);

 

/*==============================================================*/

/* Table: tb_Role_Permit                                        */

/*==============================================================*/

create table tb_Role_Permit

(

   RoleCode             varchar(100) not null,

   PermitCode           varchar(100),

   primary key (RoleCode)

);

 

/*==============================================================*/

/* Table: tb_User                                               */

/*==============================================================*/

create table tb_User

(

   UserId               varchar(20) not null,

   UserName             varchar(20),

   Password             varchar(50),

   TrueName             varchar(12),

   DeptCode             varchar(20),

   primary key (UserId)

);

 

/*==============================================================*/

/* Table: tb_User_Permit                                        */

/*==============================================================*/

create table tb_User_Permit

(

   UserId               varchar(20),

   RoleCode             varchar(100),

   PositionCode         varchar(100),

   ProjectCode          varchar(20),

   PermitCode           varchar(100)

);

 

alter table tb_Department add constraint FK_Reference_5 foreign key (CompanyCode)

      references tb_Company (CompanyCode) on delete restrict on update restrict;

 

alter table tb_Permit add constraint FK_Reference_3 foreign key (ModuleCode)

      references tb_Module (ModuleCode) on delete restrict on update restrict;

 

alter table tb_Permit add constraint FK_Reference_4 foreign key (ActionCode)

      references tb_Action (ActionCode) on delete restrict on update restrict;

 

alter table tb_Permit_Group add constraint FK_Reference_18 foreign key (PermitCode)

      references tb_Permit (PermitCode) on delete restrict on update restrict;

 

alter table tb_Position add constraint FK_Reference_21 foreign key (DeptCode)

      references tb_Department (DeptCode) on delete restrict on update restrict;

 

alter table tb_Position_Permit add constraint FK_Reference_19 foreign key (PermitCode)

      references tb_Permit (PermitCode) on delete restrict on update restrict;

 

alter table tb_Position_Permit add constraint FK_Reference_9 foreign key (PositionCode)

      references tb_Position (PositionCode) on delete restrict on update restrict;

 

alter table tb_Position_User add constraint FK_Reference_11 foreign key (PositionCode)

      references tb_Position (PositionCode) on delete restrict on update restrict;

 

alter table tb_Position_User add constraint FK_Reference_6 foreign key (UserId)

      references tb_User (UserId) on delete restrict on update restrict;

 

alter table tb_Project_User add constraint FK_Reference_22 foreign key (ProjectCode)

      references tb_Project (ProjectCode) on delete restrict on update restrict;

 

alter table tb_Project_User add constraint FK_Reference_23 foreign key (UserId)

      references tb_User (UserId) on delete restrict on update restrict;

 

alter table tb_Role_Permit add constraint FK_Reference_1 foreign key (RoleCode)

      references tb_Role (RoleCode) on delete restrict on update restrict;

 

alter table tb_Role_Permit add constraint FK_Reference_17 foreign key (PermitCode)

      references tb_Permit (PermitCode) on delete restrict on update restrict;

 

alter table tb_User add constraint FK_Reference_20 foreign key (DeptCode)

      references tb_Department (DeptCode) on delete restrict on update restrict;

 

alter table tb_User_Permit add constraint FK_Reference_12 foreign key (UserId)

      references tb_User (UserId) on delete restrict on update restrict;

 

alter table tb_User_Permit add constraint FK_Reference_13 foreign key (RoleCode)

      references tb_Role (RoleCode) on delete restrict on update restrict;

 

alter table tb_User_Permit add constraint FK_Reference_14 foreign key (PositionCode)

      references tb_Position (PositionCode) on delete restrict on update restrict;

 

alter table tb_User_Permit add constraint FK_Reference_15 foreign key (ProjectCode)

      references tb_Project (ProjectCode) on delete restrict on update restrict;

 

alter table tb_User_Permit add constraint FK_Reference_16 foreign key (PermitCode)

      references tb_Permit (PermitCode) on delete restrict on update restrict;

OA系统权限管理设计方案学习的更多相关文章

  1. OA系统权限管理设计方案

    (转)OA系统权限管理设计方案 OA系统权限管理设计方案     不同职责的人员,对于系统操作的权限应该是不同的.优秀的业务系统,这是最基本的功能.     可以对“组”进行权限分配.对于一个大企业的 ...

  2. OA系统权限管理设计方案【转】

    l 不同职责的人员,对于系统操作的权限应该是不同的.优秀的业务系统,这是最基本的功能. l 可以对“组”进行权限分配.对于一个大企业的业务系统来说,如果要求管理员为其下员工逐一分配系统操作权限的话,是 ...

  3. OA系统权限管理设计(转载)

    不论什么系统都离不开权限的管理,有一个好的权限管理模块,不仅使我们的系统操作自如,管理方便,也为系统加入亮点. l         不同职责的人员,对于系统操作的权限应该是不同的.优秀的业务系统,这是 ...

  4. OA系统 权限管理的设计流程

    版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/u013630349/article/det ...

  5. Android权限管理知识学习记录

    一.Android权限背景知识 在Android 6.0之前,所申请的权限只需要在AndroidManifest.xml列举就可以了,从而容易导致一些安全隐患,因此,在Android 6.0时,Goo ...

  6. OA(权限管理初步模块)

    权限管理:一般指根据系统设置的安全规则或者安全策略,用户可以访问而且只能访问自己被授权的资源,不多不少.权限管理几乎出现在任何系统里面,只要有用户和密码的系统. 根据权限管理的套路,我们一般从这三个角 ...

  7. 潭州课堂25班:Ph201805201 django框架 第十三课 自定义404页面,auth系统中的User模型,auth系统权限管理 (课堂笔记)

    当 DEBUG=True 时,django 内部的404报错信息, 自带的报错信息, 要自定义404信息,要先把 DEBUG=False , 之后要自定义4040页面,有两种方法, 方法1,在创建40 ...

  8. 使用shiro做权限管理的学习笔记整理

    Shiro权限管理 参考:https://www.cnblogs.com/jpfss/p/8352031.html Shiro解决的问题 授权和鉴别的问题:Authenrization(授权) Aut ...

  9. 2018/09/05《涂抹MySQL》【权限管理】学习笔记(二)

    读 第四章<管理MySQL库与表> 第五章<MySQL的权限管理> 总结 1:当配置好 MySQL 数据库后,发现有几个默认的库,他们的意义和作用?(这里只做简单了解,之后用到 ...

随机推荐

  1. POI做题记录:第二届POI

    Trees Memory limit: 32 MB Trees occur very often in computer science. As opposed to trees in nature, ...

  2. 【转】如何使用Unity创造动态的2D水体效果

    原文:http://gamerboom.com/archives/83080 作者:Alex Rose 在本篇教程中,我们将使用简单的物理机制模拟一个动态的2D水体.我们将使用一个线性渲染器.网格渲染 ...

  3. 6N137的使用

    (1)引脚图 (2)功能表 (3)内部结构图 信号从2.3脚输入,反向偏置的光敏二极管受光照后导通,经过电流电压转换,输入到与门一端,与门另一端为使能端.由于输入信号为集电极开路,需要加上拉电阻.当使 ...

  4. HDOJ 2012 素数判定

    Problem Description 对于表达式n^2+n+41,当n在(x,y)范围内取整数值时(包括x,y)(-39<=x < y<=50),判定该表达式的值是否都为素数. I ...

  5. FBReader移植日记 第二天

    昨天我们的移植工作进行了一大半,还留下两个重要的部分没有完成:1.没有移植的 ZLTextView,2.FormatPlugin相关的类. 第一个问题我们放在后面解决,下面先解决格式插件的问题. 我们 ...

  6. spring框架DI(IOC)和AOP 原理及方案

    http://www.blogjava.net/killme2008/archive/2007/04/20/112160.html http://www.oschina.net/code/snippe ...

  7. 两种常用的启动和关闭MySQL服务

    本博文的主要内容有 .通过图形界面来启动和关闭MySQL服务 .通过DOS窗口来启动和关闭MySQL服务 1.通过图形界面来启动和关闭MySQL服务 2.通过DOS窗口来启动和关闭MySQL服务 感谢 ...

  8. Google图片搜索

    本博文的主要内容有 .Google图片搜索的介绍 .Google图片之普通搜索    .Google图片之高级搜索 1.Google图片搜索的介绍   Google的图片搜索,不仅通过关键字查找拥有特 ...

  9. 西安Uber优步司机奖励政策(1月25日~1月31日)

    滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...

  10. N2N 对等VPN网络

    n2n是一个二层的虚拟专网,允许用户开发网络中典型的P2P应用而不是在应用层开发.这就意味着用户可以透明的得到本地地址,只要新的IP地址在一个子网内,无论两台机器处于什么位置都能够ping通对方. N ...