(九)設計員工表與使用者表

2021-10-03 06:29:22 字數 3343 閱讀 8151

`id` int unsigned not null auto_increment comment '主鍵',

`dname` varchar(20) not null comment '部門名稱',

primary key (`id`),

unique index `unq_dname`(`dname`)

) comment = '部門表';

`id` int unsigned not null auto_increment comment '主鍵',

`job` varchar(20) not null comment '職位名稱',

primary key (`id`),

unique `unq_job`(`job`)

) comment = '職位表';

`id` int unsigned primary key auto_increment comment '主鍵',

`wid` varchar(20) not null comment '工號',

`ename` varchar(20) not null comment '姓名',

`***` char(1) not null comment '性別',

`married` tinyint(1) not null comment '婚否',

`education` tinyint not null comment '學歷:1大專,2本科,3研究生,4博士,5其他',

`tel` char(11) not null comment '**',

`email` varchar(200) comment '郵箱',

`address` varchar(200) comment '住址',

`job_id` int unsigned not null comment '職務id',

`dept_id` int unsigned not null comment '部門id',

`mgr_id` int unsigned comment '上司id',

`hiredate` date not null comment '入職日期',

`termdate` date comment '離職日期',

`status` tinyint unsigned not null comment '狀態:1在職,2休假,3離職,4死亡',

unique `unq_wid`(`wid`),

index `idx_job_id`(`job_id`),

index `idx_dept_id`(`dept_id`),

index `idx_status`(`status`),

index `idx_mgr_id`(`mgr_id`),

index `idx_wid`(`wid`)

) comment = '員工表';

`id` int(10) unsigned primary key auto_increment comment '主鍵',

`role` varchar(20) not null comment '角色名稱',

unique `unq_role`(`role`)

) comment = '角色表';

create table `t_user`  (

`id` int unsigned not null auto_increment comment '主鍵',

`username` varchar(200) not null comment '使用者名稱',

`password` varchar(2000) not null comment '密碼(aes加密)',

`emp_id` int unsigned not null comment '員工id',

`role_id` int unsigned not null comment '角色id',

`status` tinyint unsigned not null comment '狀態:1 可用,2 禁用',

`create_time` timestamp not null default now() comment '新增時間',

`last_update_time` timestamp not null default now() comment '最後修改時間',

primary key (`id`),

unique index `unq_username`(`username`),

index `idx_username`(`username`),

index `idx_emp_id`(`emp_id`),

index `idx_role_id`(`role_id`),

index `idx_status`(`status`)

) comment = '使用者表';

OpenERP雇員(員工)表與使用者表關聯字段解析

csdn公升級空間後,居然更慢了。難道換db了?題外話,很久沒回來,剛開啟的感覺很不好。最近忙研究openerp,乙個優秀的開源專案。在oe7.0中,雇員 員工在hr模組下,而使用者在設定裡 組下面 雇員 員工表是hr employee,使用者表是res users。結論 hr em csdn公升級...

使用者表,角色表,許可權表的設計思想

就是使用者表,角色表,許可權表,然後再插入中間表,使用者角色對應表,角色許可權對應表,不要直接把使用者表與許可權表相對應,乙個使用者應該屬於某個角色,比如系統管理員,那麼這個角色應該有某些許可權。就這樣。方案一 功能 模組 表 資料元素 功能編號 funid 功能名稱 funname 功能說明 fu...

使用者登入 日誌表 設計

表設計 指令碼 use master gocreate table dbo logloginon id bigint identity 1,1 not null,inputloginname varchar 50 null,clientip varchar 15 null,memberid bigi...