LEFT JOIN sys_org_element e on e.fd_id = h.fd_3ade318b64b54c JOIN sys_org_person p on e.fd_id=p.fd_id
where d.fd_id = #{fdId}
) a
GROUP BY a.USER_ID
GROUP BY a.USER_ID**/
select
e.fd_id as 'ID',
e.fd_name as 'EMP_NAME',
e.fd_name_pinyin as 'EMP_LOGIN_NAME',
e.fd_ldap_dn as "EMP_DEPT",
4 as 'PERMISSION_TYPE',
b.fd_3ade334bac0016 as 'NAME',
b.fd_3ade33763baa0e as "CODE",
1 as "IS_CONTAINS",
0 as "PERMISSION_STATUS",
1 as "DELETE_FLAG",
1 as 'CREATE_BY',
1 as 'UPDATE_BY',
"超管" as 'CREATE_NAME',
NOW() as 'UPDATE_TIME',
NOW() as 'CREATE_TIME',
null as "DOMAIN_ID",
0 as "SOURCE_TYPE"
from ekporg_18382406ad7dbdebcf33 a
LEFT JOIN ekp_0103c453b2848c3bb31c b on a.fd_parent_id=b.fd_id
LEFT JOIN sys_user_permission c on c.`CODE`=b.fd_3ade33763baa0e and c.USER_ID=a.sys_org_person_id
LEFT JOIN (select x.fd_id,x.fd_name,SUBSTRING_INDEX(SUBSTRING_INDEX(x.fd_ldap_dn,',ou', 2),',ou=', -1) as 'fd_ldap_dn',x.fd_name_pinyin from sys_org_element x where x.fd_org_type='8') e on a.sys_org_person_id=e.fd_id
LEFT JOIN ekp_224c54af6ae4418ae0a2 d on d.fd_3b879793d37afe=b.fd_3ade33763baa0e