• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            唐吉訶德

              C++博客 :: 首頁 :: 聯系 :: 聚合  :: 管理
              5 Posts :: 75 Stories :: 3 Comments :: 0 Trackbacks

            常用鏈接

            留言簿(2)

            我參與的團隊

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            國慶前整的通用權限設計的數據庫初步設計部分,現在貼上來。

            理清了對象關系之后,讓我們接著來進行數據庫的設計。在數據庫建模時,對于NN的關系,一般需要加入一個關聯表來表示關聯的兩者的關系。初步估計一下,本系統至少需要十張表,分別為:權限表、用戶表、角色表、組表、用戶權限關聯表、用戶角色關聯表、角色權限關聯表、組權限關聯表、組角色關聯表、用戶屬組關聯表。當然還可能引出一些相關的表。下面讓我們在PowerDesigner中畫出各表吧。

                   各表及其關系如下:


                  

            1.       用戶表

            用戶表(TUser

            字段名稱

            字段

            類型

            備注

            記錄標識

            tu_id

            bigint

            pk, not null

            所屬組織

            to_id

            bigint

            fk, not null

            登錄帳號

            login_name

            varchar(64)

            not null

            用戶密碼

            password

            varchar(64)

            not null

            用戶姓名

            vsername

            varchar(64)

            not null

            手機號

            mobile

            varchar(20)

            電子郵箱

            email

            varchar(64)

            創建時間

            gen_time

            datetime

            not null

            登錄時間

            login_time

            datetime

            上次登錄時間

            last_login_time

            datetime

            登錄次數

            count

            bigint

            not null

            2.       角色表

            角色表(TRole

            字段名稱

            字段

            類型

            備注

            角色ID

            tr_id

            bigint

            pk, not null

            父級角色ID

            parent_tr_id

            bigint

            not null

            角色名稱

            role_name

            varchar(64)

            not null

            創建時間

            gen_time

            datetime

            not null

            角色描述

            description

            varchar(200)

            3.       權限表

            權限表(TRight

            字段名稱

            字段

            類型

            備注

            權限ID

            tr_id

            bigint

            pk, not null

            父權限

            parent_tr_id

            bigint

            not null

            權限名稱

            right_name

            varchar(64)

            not null

            權限描述

            description

            varchar(200)

            4.       組表

            組表(TGroup

            字段名稱

            字段

            類型

            備注

            ID

            tg_id

            bigint

            pk, not null

            組名稱

            group_name

            varchar(64)

            not null

            父組

            parent_tg_id

            bigint

            not null

            創建時間

            gen_time

            datetime

            not null

            組描述

            description

            varchar(200)

            5.       角色權限表

            角色權限表(TRoleRightRelation

            字段名稱

            字段

            類型

            備注

            記錄標識

            trr_id

            bigint

            pk, not null

            角色

            Role_id

            bigint

            fk, not null

            權限

            right_id

            bigint

            fk, not null

            權限類型

            right_type

            int

            not null0:可訪問,1:可授權)

            6.       組權限表

            組權限表(TGroupRightRelation

            字段名稱

            字段

            類型

            備注

            記錄標識

            tgr_id

            bigint

            pk, not null

            tg_id

            bigint

            fk, not null

            權限

            tr_id

            bigint

            fk, not null

            權限類型

            right_type

            int

            not null0:可訪問,1:可授權)

            7.       組角色表

            組角色表(TGroupRoleRelation

            字段名稱

            字段

            類型

            備注

            記錄標識

            tgr_id

            bigint

            pk, not null

            tg_id

            bigint

            fk, not null

            角色

            tr_id

            bigint

            pk, not null

            8.       用戶權限表

            用戶權限表(TUserRightRelation

            字段名稱

            字段

            類型

            備注

            記錄標識

            tur_id

            bigint

            pk, not null

            用戶

            tu_id

            bigint

            fk, not null

            權限

            tr_id

            bigint

            fk, not null

            權限類型

            right_type

            int

            not null0:可訪問,1:可授權)

            9.       用戶角色表

            用戶角色表(TUserRoleRelation

            字段名稱

            字段

            類型

            備注

            記錄標識

            tur_id

            bigint

            pk, not null

            用戶

            tu_id

            bigint

            fk, not null

            角色

            tr_id

            bigint

            fk, not null

            10.   用戶組表

            用戶組表(TUserGroupRelation

            字段名稱

            字段

            類型

            備注

            記錄標識

            tug_id

            bigint

            pk, not null

            用戶

            tu_id

            bigint

            fk, not null

            tg_id

            bigint

            fk, not null

            11.   組織表

            組織表(TOrganization

            字段名稱

            字段

            類型

            備注

            組織id

            to_id

            bigint

            pk, not null

            父組

            parent_to_id

            bigint

            not null

            組織名稱

            org_name

            varchar(64)

            not null

            創建時間

            gen_time

            datetime

            not null

            組織描述

            description

            varchar(200)

            12.   操作日志表

            操作日志表(TLog

            字段名稱

            字段

            類型

            備注

            日志ID

            log_id

            bigint

            pk, not null

            操作類型

            op_type

            int

            not null

            操作內容

            content

            varchar(200)

            not null

            操作人

            tu_id

            bigint

            fk, not null

            操作時間

            gen_time

            datetime

            not null

            posted on 2010-08-27 11:40 心羽 閱讀(1006) 評論(0)  編輯 收藏 引用 所屬分類: 需求分析
            色欲综合久久躁天天躁蜜桃| 亚洲日本va午夜中文字幕久久 | 久久国产AVJUST麻豆| 久久精品国产亚洲一区二区三区| 久久久久国产精品嫩草影院| 狠狠色丁香久久婷婷综合| 天天爽天天狠久久久综合麻豆| 久久综合欧美成人| 久久久久久久精品妇女99| 久久九九有精品国产23百花影院| 久久久99精品成人片中文字幕| 亚洲中文字幕无码久久综合网| 久久er国产精品免费观看2| 亚洲人成网站999久久久综合| 久久不射电影网| 国产aⅴ激情无码久久| 久久av高潮av无码av喷吹| 久久久久久午夜成人影院 | 久久国产精品-国产精品| 久久久久久精品无码人妻| 久久综合九色综合久99| 国内高清久久久久久| 久久99久久成人免费播放| 99久久精品日本一区二区免费| 亚洲伊人久久综合中文成人网| 日本道色综合久久影院| 97r久久精品国产99国产精| 亚洲va中文字幕无码久久不卡| 亚洲午夜福利精品久久| 性做久久久久久久久老女人| 91精品观看91久久久久久| 成人国内精品久久久久影院| 久久99热这里只有精品66| 欧美性猛交xxxx免费看久久久| 久久AⅤ人妻少妇嫩草影院| 久久久网中文字幕| 久久精品亚洲欧美日韩久久| 久久精品一区二区三区中文字幕| 国产亚州精品女人久久久久久 | 久久精品国产72国产精福利| 99久久精品无码一区二区毛片|