帆软系统-查看拥有某个菜单权限的用户

Oracle版:

WITH a as(
SELECT
b.displayName,
b.deviceType,
dbms_lob.substr(b.path) as path,
c.realName,
c.userName,
e.name
FROM
FR10SYS.fine_authority  a
LEFT JOIN FR10SYS.fine_authority_object  b ON a.authorityEntityId = b.id
RIGHT  JOIN FR10SYS.fine_user  c ON a.roleId = c.id 
LEFT JOIN  FR10SYS.fine_user_role_middle  d ON c.id = d.userId
LEFT JOIN FR10SYS.fine_custom_role  e on d.roleId=e.id
WHERE
a.authorityType = 1 AND
a.authority = 2
)
, b as(
SELECT
b.displayName,
b.deviceType,
dbms_lob.substr(b.path) as path,
e.realName,
e.userName,
c.name
FROM
FR10SYS.fine_authority  a
LEFT JOIN FR10SYS.fine_authority_object  b ON a.authorityEntityId = b.id
LEFT JOIN FR10SYS.fine_custom_role  c ON a.roleId = c.id
LEFT JOIN FR10SYS.fine_user_role_middle  d ON c.id = d.roleId
right JOIN FR10SYS.fine_user  e ON d.userId = e.id
WHERE
a.authorityType = 1 AND
a.authority = 2
)
,c as
(SELECT * FROM a 
UNION 
SELECT * FROM b)


SELECT * from c 
 

SqlServer版:

WITH a as(
SELECT
b.displayName,
b.deviceType,
b.path,
c.realName,
c.userName,
e.name
FROM
dbo.fine_authority AS a
LEFT JOIN dbo.fine_authority_object AS b ON a.authorityEntityId = b.id
RIGHT  JOIN dbo.fine_user AS c ON a.roleId = c.id 
LEFT JOIN  dbo.fine_user_role_middle AS d ON c.id = d.userId
LEFT JOIN dbo.fine_custom_role as e on d.roleId=e.id
WHERE
a.authorityType = 1 AND
a.authority = 2
)
, b as(
SELECT
b.displayName,
b.deviceType,
b.path,
e.realName,
e.userName,
c.name
FROM
dbo.fine_authority AS a
LEFT JOIN dbo.fine_authority_object AS b ON a.authorityEntityId = b.id
LEFT JOIN dbo.fine_custom_role AS c ON a.roleId = c.id
LEFT JOIN dbo.fine_user_role_middle AS d ON c.id = d.roleId
right JOIN dbo.fine_user AS e ON d.userId = e.id
WHERE
a.authorityType = 1 AND
a.authority = 2
)
,c as
(SELECT * FROM a 
UNION 
SELECT * FROM b)
SELECT * from c 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值