select per.departmentcode,per.departmentname, per.personcode,per.personname
from tujiawang.oa_person per where per.personcode not in (select distinct ej.empcode from tujiawang.tj_hr_employeejob ej where ej.hr_status='A' and ej.empl_status='A')
and per.departmentcode not in ('BL001') and per.departmentname not like '%新业务孵化%'
order by per.departmentcode;
insert into dml_T_ORG_PositionMember select * from T_ORG_PositionMember where fpersonid in (select fid from t_bd_person where fnumber in (select personcode from oa_person where personcode in (select empcode from TJ_HR_EMPLOYEEJOB where Hr_Status='I' and Empl_Status='T')));
update T_HR_PersonPosition set FGKAdminID='00000000-0000-0000-0000-000000000000CCE7AED4',FPersonDep='00000000-0000-0000-0000-000000000000CCE7AED4' where FPersonID in (select fid from t_bd_person where fnumber in (select personcode from oa_person where personcode in (select empcode from TJ_HR_EMPLOYEEJOB where Hr_Status='I' and Empl_Status='T')));
delete from T_ORG_PositionMember where fpersonid in (select fid from t_bd_person where fnumber in (select personcode from oa_person where personcode in (select empcode from TJ_HR_EMPLOYEEJOB where Hr_Status='I' and Empl_Status='T')));