luojian0323 回复 omydaidai(提问者)就想要现成的吧
select a.username 用户名,a.realname 姓名,d.name 部门,e.name 角色 from fine_user a
left join
fine_user_role_middle b
on a.id=b.userid
left join fine_dep_role c
on b.roleid=c.id
left join fine_department d
on c.departmentid=d.id
left join fine_custom_role e
on b.roleid=e.id
Z4u3z1 回复 omydaidai(提问者)SELECT a.realAlias,a.realName,c.name FROM fine_user a
left join fine_dep_role b on a.id=b.id
left join fine_department c on b.departmentId=c.id