select a.id userid,a.username,a.realname,b.[CustomRoleid],c.[rolename],e.name deptname,f.postname
from finedb.dbo.fr_t_user a
left join finedb.dbo.[FR_T_CustomRole_User] b on a.id = b.userid
left join [finedb].[dbo].[FR_T_CUSTOMROLE] c on b.[CustomRoleid] = c.id
left join [finedb].[dbo].[FR_T_Department_Post_User] d on a.id = d.userid
left join [finedb].[dbo].[FR_T_DEPARTMENT] e on d.[Departmentid] = e.id
left join [finedb].[dbo].[FR_T_POST] f on d.[Postid] = f.id
帆软决策平台用户 角色 部门 岗位 一览表