SELECT
ad.account,
ad.id,
ad.create_time,
ad.canteen,
ct.name as ct_name,
ad.company,
cp.name as cp_name,
ar.rid,
r.rname
from admin ad
INNER JOIN canteen ct on ct.id = ad.canteen
INNER JOIN company cp on cp.id = ad.company
INNER JOIN admin_role ar on ar.uid = ad.id
INNER JOIN role r on r.rid = ar.rid
where ad.id = 'b66d2c0a69a748d2bf52ce4ff86ba341'
查询结果: