根据员工变动记录更新档案历史期间的组织和职位
解决方案:
问题:根据员工变动记录更新档案历史期间的组织和职位
【适用版本】
通用
【分析处理】
--备份数据
select * into attendancefilehis0612 from t_hr_ats_attendancefilehis
--修复数据
update t_hr_ats_attendancefilehis a set FADMINORGUNITID=( select FADMINORGID from t_hr_emporgrelation
where fassigntype=1 and fisinner=1 and fpersonid=a.fproposerid and a.feffdt>=feffdt and a.fleffdt<=fleffdt
)
where fid in(select a.fid
from t_hr_ats_attendancefilehis a
inner join t_hr_emporgrelation b on a.fproposerid=b.fpersonid and a.feffdt>=b.feffdt and a.fleffdt<=b.fleffdt and b.fassigntype=1 and fisinner=1
where a.FADMINORGUNITID <>b.FADMINORGID or a.FPOSITIONID <>b.FPOSITIONID
)
update t_hr_ats_attendancefilehis a set Fpositionid=( select Fpositionid from t_hr_emporgrelation
where fassigntype=1 and fisinner=1 and fpersonid=a.fproposerid and a.feffdt>=feffdt and a.fleffdt<=fleffdt
)
where fid in(select a.fid
from t_hr_ats_attendancefilehis a
根据员工变动记录更新档案历史期间的组织和职位
本文2024-09-22 22:02:21发表“s-hr cloud知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-shr-123991.html