select t1.id as userid,t2.id as roleid,t2.name as rolename,t3.name as permissonname
from user t1 left join role t2 on t1.id=t2.id
left join Permission t3 on t2.id=t3.id
where t1.id=1
select a.UserID , b.Roleid,b. RoleName, c. PermissionName from user a
left join Role b on a.id=b.id
left join Permission c on b.id=c.id
大概就是这样