标签:
权限表(permission)10
字段名称 |
类型 |
约束 |
描述 |
authorityid |
integer |
Pk not null |
权限流水号id PK |
userNameId |
int |
not null |
用户名id FK |
functionid |
integer |
Not null |
功能 id FK |
lookPermission |
int |
not null |
浏览 |
addPermission |
int |
not null |
添加 |
editPermission |
int |
not null |
编辑 |
deletePermission |
int |
not null |
删除 |
checkPermission |
int |
not null |
审核 |
againstrCheckPermission |
int |
not null |
反审核 |
statementPermission |
int |
not null |
报表 |
功能模块表(functionComponents)3
字段名称 |
类型 |
约束 |
模块名称描述 |
functionCpId |
integer |
pk |
功能id PK |
funDescribe |
Varchar(100) |
not null |
模块名称 |
otherInfo |
Varchar(500) |
not null |
备注 |
用户表(userInfo)
字段名称 |
类型 |
约束 |
描述 |
userNo |
integer |
Pk not null |
权限流水号id PK |
userName |
varchar2(20) |
not null |
用户名id FK |
userPwd |
varchar2(20) |
not null |
浏览 |
role |
varchar2(20) |
not null |
浏览 |
查询出用户对应的功能的权限
刚开始,我用的是子查询,没有实现
Select userNo ,userInfo.userName, userInfo.userPwd, funDescribe, lookPermission, addPermission, editPermission, deletePermission, checkPermission, againstrCheckPermission, statementPermission from userInfo, permission, functionComponents
改为:
Select userNo ,userInfo.userName, userInfo.userPwd, funDescribe, lookPermission, addPermission, editPermission, deletePermission, checkPermission, againstrCheckPermission, statementPermission from userInfo, permission, functionComponents group by userNo
同样不对!
后来就换成,三个表内连接的查询
Create view ` userFunPermission `AS
Select userNo ,userInfo.userName, userInfo.userPwd, funDescribe, lookPermission, addPermission, editPermission, deletePermission, checkPermission, againstrCheckPermission, statementPermission from userInfo, permission, functionComponents
可以了!
标签:
原文地址:http://www.cnblogs.com/nucdy/p/5789715.html