​s-HR组织人事常见业务SQL

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

​s-HR组织人事常见业务SQL

**市场部所有人,含兼职和离职** ```language SELECT person.* FROM T_hr_emporgrelation relation LEFT OUTER JOIN T_bd_person person ON RELATION.FPERSONID = PERSON.FID LEFT OUTER JOIN T_org_admin adm ON RELATION.FRELATEADMINID = ADM.FID LEFT OUTER JOIN T_HR_EmpLaborRelation labor ON RELATION.FLABORRELATIONID = LABOR.FID LEFT OUTER JOIN T_HR_BDEmployeeType empType ON labor.FLaborRelationStateID = EMPTYPE.FID where relation.FLEFFDT ={ts '2199-12-31'} and adm.FNAME_l2 = '市场部'; ``` **总经理职位上所有人,含兼职和离职** ```language SELECT person.* FROM T_hr_emporgrelation relation LEFT OUTER JOIN T_bd_person person ON RELATION.FPERSONID = PERSON.FID LEFT OUTER JOIN T_org_position position ON RELATION.FPOSITIONID = POSITION.FID LEFT OUTER JOIN T_HR_EmpLaborRelation labor ON RELATION.FLABORRELATIONID = LABOR.FID LEFT OUTER JOIN T_HR_BDEmployeeType empType ON labor.FLaborRelationStateID = EMPTYPE.FID where relation.FLEFFDT ={ts '2199-12-31'} and position.FNAME_l2 = '总经理'; ``` **市场部负责人,含兼职和离职** ```language SELECT person.* FROM T_hr_emporgrelation relation LEFT OUTER JOIN T_bd_person person ON RELATION.FPERSONID = PERSON.FID LEFT OUTER JOIN T_org_admin adm ON RELATION.FPOSITIONID = adm.FResponPositionID LEFT OUTER JOIN T_HR_EmpLaborRelation labor ON RELATION.FLABORRELATIONID = LABOR.FID LEFT OUTER JOIN T_HR_BDEmployeeType empType ON labor.FLaborRelationStateID = EMPTYPE.FID where relation.FLEFFDT ={ts '2199-12-31'} and adm.FNAME_l2 = '市场部'; ``` **员工张三的上级** ```language SELECT parent.* FROM T_hr_emporgrelation relation LEFT OUTER JOIN T_bd_person person ON RELATION.FPERSONID = PERSON.FID LEFT OUTER JOIN T_org_position position ON RELATION.FPOSITIONID = POSITION.FID inner JOIN T_hr_emporgrelation parentrelation on position.FPARENTID = parentrelation.FPOSITIONID and parentrelation.FLEFFDT ={ts '2199-12-31'} LEFT OUTER JOIN T_bd_person parent ON parentrelation.FPERSONID = parent.FID LEFT OUTER JOIN T_HR_BDEmployeeType empType ON parent.FEmployeeTypeID = EMPTYPE.FID where relation.FLEFFDT ={ts '2199-12-31'} and empType.FISINCOUNT =1 and person.FNAME_l2 = '张三'; ```

​s-HR组织人事常见业务SQL

**市场部所有人,含兼职和离职**```languageSELECT person.* FROM T_hr_emporgrelation relation LEFT OUTER JOIN T_bd_person pe...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息