22,302
社区成员




insert into hrmManager (hm_xm,hm_jbgz,hm_jx) select hr_xm,hr_jbgz,hr_jx from hrmConfig tb where not exists (select 1 from hrmConfig where hm_xm=tb.hm_xm)
insert into hrmManager (hm_xm,hm_jbgz,hm_jx)
select hr_xm,hr_jbgz,hr_jx
from hrmConfig t
where not exists(
select 1
from hrmManager
where hm_xm=t.hm_xm
and datediff(mm,getdate(),hm_createDate)=0
)
--hrmManager 添加 hr_id
insert into hrmManager (hr_id, hm_xm,hm_jbgz,hm_jx) select hr_id, hr_xm,hr_jbgz,hr_jx from hrmConfig t
where not exists (select 1 from hrmManager where hr_id=t.hr_id and month(hm_createDate)=month(getdate()))
insert into hrmManager (hm_xm,hm_jbgz,hm_jx)
select hr_xm,hr_jbgz,hr_jx from hrmConfig t
where not exists(select 1 from hrmConfig where hm_xm=t.hm_xm and datediff(mm,hm_createDate,t.hm_createDate)=0)