学习之: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. HDU --2665

    Kth number Time Limit: 15000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...

  2. poj -2975 Nim

      Nim Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 4312   Accepted: 1998 Description ...

  3. Unity Chan Advanced

    1. 8X MSAA 2. SMAA 3. ViewSpace Outline 4. Unity Chan Skin 5. Shift Toon Lighting 6. DOF 7. Bloom

  4. BCTF赛后

    今天早上八点,BTCF第一届落幕.虽然没有熬夜coding但还是十分开心. 从收到超哥的邀请,到回头组队,一开始的十几人,最后演化为五人的精简小分队,到昨晚把所有有想法的题目全部搞定,十分的开心和欣慰 ...

  5. 从spark架构中透视job

    本博文的主要内容如下: 1.通过案例观察Spark架构 2.手动绘制Spark内部架构 3.Spark Job的逻辑视图解析 4.Spark Job的物理视图解析 1.通过案例观察Spark架构 sp ...

  6. Div 3 - SGU 105(找规律)

    分析:很容易知道序列1,2,3, 4,5, 6......与3的关系就是1,2, 0,1, 2,0,......如果是在一个数后面添加一个数就变成了这种序列1, 0, 0, 1, 0, 0, 1, 0 ...

  7. 410. Split Array Largest Sum

    做了Zenefits的OA,比面经里的简单多了..害我担心好久 阴险的Baidu啊,完全没想到用二分,一开始感觉要用DP,类似于极小极大值的做法. 然后看了答案也写了他妈好久. 思路是再不看M的情况下 ...

  8. highcharts动态获取数据生成图表问题

    动态获取数据说白点就是从后台传值到前台,前台把这些值赋值给x轴与y轴(这里指的是你X轴与Y轴都是变化的数据,如果你的X轴是固定的,像时间等等的那就另说).  柱状图的动态传值: //获取后台数据 va ...

  9. SSH服务及花生壳域名解析

    一.安装说明以CentOS 5为例 1.安装必要的开发包 [root@localhost ~]# yum install gcc gcc-c++ autoconf automake 2.下载phddn ...

  10. OBJ解析

    OBJ文件是Alias|Wavefront公司为它的一套基于工作站的3D建模和动画软件"Advanced Visualizer"开发的一种标准3D模型文件格式,很适合用于3D软件模 ...