SELECT g.fname 组织名称,a.FUSERID AS 用户内码, a.FNAME 用户名,b.FPERSONID AS 人员内码,bl.FNAME AS 人员姓名,
f.fid 员工内码,f1.FNUMBER 员工编码,f.fname 员工名称,c.FSTAFFNUMBER 员工任岗编码,d.FNUMBER 任岗部门编码,
dl.FNAME AS 任岗部门名称,e.FNUMBER 任岗岗位编码,el.FNAME AS 任岗岗位名称 FROM T_SEC_USER a -- 用户表
INNER JOIN T_BD_PERSON b ON a.FLINKOBJECT = b.FPERSONID -- 人员表
LEFT JOIN T_BD_PERSON_L bl ON b.FPERSONID=bl.FPERSONID AND bl.FLOCALEID=2052
INNER JOIN T_BD_STAFF c ON b.FPERSONID=c.FPERSONID -- 员工任岗表
LEFT JOIN T_BD_DEPARTMENT d ON c.FDEPTID=d.FDEPTID -- 部门表
LEFT JOIN T_BD_DEPARTMENT_L dl ON d.FDEPTID=dl.FDEPTID AND dl.FLOCALEID=2052
LEFT JOIN T_ORG_POST e ON c.FPOSTID=e.FPOSTID -- 岗位表
LEFT JOIN T_ORG_POST_L el ON e.FPOSTID=el.FPOSTID AND el.FLOCALEID=2052
left join T_HR_EMPINFO_L f on f.fid=c.FEMPINFOID and f.FLOCALEID=2052
left join T_HR_EMPINFO f1 on f1.fid=f.fid
left join T_ORG_ORGANIZATIONS_L g on g.forgid=f1.FUSEORGID and g.FLOCALEID=2052
WHERE a.FNAME='ybx'
使用前提:建立员工与用户的关联关系
推荐阅读