查询员工所有企业内工作经历sql

栏目:s-hr cloud知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:2

查询员工所有企业内工作经历sql

通过如下sql在查询分析器执行,可以查出员工所有系统内及系统外的企业任职经历,通过最后的字段替换为相应的员工姓名,可以查询指定员工的所有企业内任职经历;去掉最后一行where条件可以查询所有的,。通过查询分析器查询会有显示条数限制,可能无法显示全部记录

SELECT
--"EMPPOSORGRELATION".FID AS "ID",
"EMPPOSORGRELATION".FEFFDT AS "开始日期",
"EMPPOSORGRELATION".FLEFFDT AS "结束日期",
"EMPPOSORGRELATION".FAssignType AS "任职类型",
--"EMPPOSORGRELATION".FAdminOrgID AS "ADMINORG.ID",
CASE WHEN "EMPPOSORGRELATION".FIsInner = 1 THEN "ADMINORG".FDisplayName_l2 ELSE "EMPPOSORGRELATION".FAdminOrgTxt END AS "任职组织全称",
--"ADMINORG".FNumber AS "ADMINORG.NUMBER",
--"ADMINORG".FLongNumber AS "ADMINORG.LONGNUMBER",
--"EMPPOSORGRELATION".FPositionID AS "POSITION.ID",
CASE WHEN "EMPPOSORGRELATION".FIsInner = 0 THEN "EMPPOSORGRELATION".FPositionTxt

ELSE
"POSITION".FName_l2 END AS "任职岗位名称",
--CASE WHEN "EMPPOSORGRELATION".FIsInner = 0 THEN "EMPPOSORGRELATION".FCorporateunitTxt ELSE
-- "CORPORATEUNIT".FName_l2 END AS "CORPORATEUNITNAME",
--"EMPPOSORGRELATION".FPersonID AS "PERSON.ID",
"PERSON".FName_l2 AS "PERSON.NAME",
"PERSON".FNumber AS "员工编码",
"PERSON".FGender AS "性别",
"PERSON".FIDCardNO AS "身份证号",
"PERSON".FPassportNO AS "护照号",
"EMPPOSORGRELATION".FIsInner AS "是否系统内任职(1为是)",
"EMPPOSORGRELATION".FRemark AS "备注"

FROM T_HR_EmpOrgRelation AS "EMPPOSORGRELATION"

LEFT OUTER JOIN T_ORG_Admin AS "ADMINORG"
ON "EMPPOSORGRELATION".FAdminOrgID = "ADMINORG".FID

LEFT OUTER JOIN T_BD_Person AS "PERSON"
ON "EMPPOSORGRELATION".FPersonID = "PERSON".FID

LEFT OUTER JOIN T_ORG_Position AS "POSITION"
ON "EMPPOSORGRELATION".FPositionID = "POSITION".FID

LEFT OUTER JOIN T_HR_EmpLaborRelation AS "LABORRELATION"
ON "EMPPOSORGRELATION".FlaborRelationID = "LABORRELATION".FID

LEFT OUTER JOIN T_ORG_Admin AS "CORPORATEUNIT"
ON "LABORRELATION".FCorporateunitID = "CORPORATEUNIT".FID
where "PERSON".fname_l2 ='李志谦'//替换员工姓名

查询员工所有企业内工作经历sql

通过如下sql在查询分析器执行,可以查出员工所有系统内及系统外的企业任职经历,通过最后的字段替换为相应的员工姓名,可以查询指定员工的...
点击下载文档
分享:
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息