–已知人员,查询人员总共有多少权限和对应角色
select a.id 角色id,a.rolesmark 角色名称,c.id 权限id,c.rightdesc 权限名称,d.resourceid 人员id,e.lastname 姓名 from hrmroles a,SystemRightRoles b,SystemRights c,hrmrolemembers d,hrmresource e
where a.id=b.roleid and b.rightid=c.id and a.id=d.roleid and d.resourceid =e.id
and e.id=
order by a.rolesmark
–已知权限查询涉及此权限的人员和角色
select a.id 角色id,a.rolesmark 角色名称,c.id 权限id,c.rightdesc 权限名称,d.resourceid 人员id,e.lastname 姓名 from hrmroles a,SystemRightRoles b,SystemRights c,hrmrolemembers d,hrmresource e
where a.id=b.roleid and b.rightid=c.id and a.id=d.roleid and d.resourceid =e.id
and c.id=120
order by a.rolesmark
获取权限id的方法: