• <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)  編輯 收藏 引用 所屬分類: 需求分析
            久久久久国产精品嫩草影院| 久久久久久久久无码精品亚洲日韩| 韩国免费A级毛片久久| 国产∨亚洲V天堂无码久久久| 久久精品成人免费网站| 久久精品成人免费国产片小草 | 久久精品国产亚洲77777| 久久青草国产精品一区| 亚洲国产成人久久精品99| 日韩乱码人妻无码中文字幕久久| 国产精品久久久久影院色| 久久国产精品无码网站| 久久er99热精品一区二区| 久久精品国产亚洲Aⅴ香蕉| 亚洲成色WWW久久网站| 精品久久人人做人人爽综合| 久久亚洲AV成人无码国产| 久久综合成人网| 夜夜亚洲天天久久| 一本色道久久88精品综合| 久久精品无码一区二区app| 99久久国语露脸精品国产| 久久精品国产AV一区二区三区| 丁香久久婷婷国产午夜视频| 精品永久久福利一区二区 | 久久夜色精品国产噜噜噜亚洲AV| 国内精品久久久久国产盗摄| 粉嫩小泬无遮挡久久久久久| 99精品国产99久久久久久97| 色偷偷91久久综合噜噜噜噜| 久久久久综合国产欧美一区二区| 色偷偷888欧美精品久久久| 日韩av无码久久精品免费| 无码超乳爆乳中文字幕久久| 久久久久久久精品成人热色戒 | 亚洲欧美精品一区久久中文字幕| 国产精品久久久99| 久久精品国产精品亚洲| 久久亚洲国产精品五月天婷| 婷婷久久精品国产| 漂亮人妻被中出中文字幕久久|