|
|
|
@ -118,11 +118,46 @@
|
|
|
|
|
where time_start <= convert(varchar(100),getDate(),23) and time_end > convert(varchar(100),getDate(),23)) and delete_type=0
|
|
|
|
|
group by job_id) e on a.id=e.job_id
|
|
|
|
|
left join (select jobtitle,count(1) fcnt from hrmresource group by jobtitle) f
|
|
|
|
|
on f.JOBTITLE=a.id
|
|
|
|
|
on f.JOBTITLE=a.ec_jobTitle
|
|
|
|
|
left join HrmJobTitles g on a.ec_jobTitle = g.id
|
|
|
|
|
where isnull(a.delete_type,0) <> 1 and isnull(a.forbidden_tag,0) <> 1
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--同步部门信息-->
|
|
|
|
|
<insert id="insertDeptToMap">
|
|
|
|
|
insert into jcl_org_map
|
|
|
|
|
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleader,fleaderimg,
|
|
|
|
|
fleadername,fleaderjobid,fleaderjob,fleaderlv,fleaderst,fparentid,fobjparentid,
|
|
|
|
|
fplan,fonjob,fisvitual,fdatebegin,fdateend)
|
|
|
|
|
select a.id+100000000,2,a.id,a.uuid,0,'行政维度',a.DEPARTMENTCODE,a.departmentname,cast(a.BMFZR as varchar(10)),b.messagerurl,
|
|
|
|
|
b.lastname,b.jobtitle,c.jobtitlemark,null,null,
|
|
|
|
|
(case isnull(a.supdepid,0) when 0 then a.subcompanyid1 else a.supdepid+100000000 end),
|
|
|
|
|
(case isnull(a.supdepid,0) when 0 then a.subcompanyid1 else a.supdepid end),
|
|
|
|
|
0,0,0,convert(varchar(100),getDate(),23),'2099-12-31'
|
|
|
|
|
from
|
|
|
|
|
HrmDepartment as a
|
|
|
|
|
left join hrmresource as b on cast(a.BMFZR as varchar(10))=cast(b.ID as varchar(10))
|
|
|
|
|
left join hrmjobtitles as c on b.JOBTITLE=c.id
|
|
|
|
|
where isnull(a.canceled,0) <> 1
|
|
|
|
|
</insert>
|
|
|
|
|
<!--同步分部信息-->
|
|
|
|
|
<insert id="insertSubComToMap">
|
|
|
|
|
insert into jcl_org_map
|
|
|
|
|
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleader,fleaderimg,
|
|
|
|
|
fleadername,fleaderjobid,fleaderjob,fleaderlv,fleaderst,fparentid,fobjparentid,
|
|
|
|
|
fplan,fonjob,fisvitual,fdatebegin,fdateend)
|
|
|
|
|
select a.id,1,a.id,a.uuid,0,'行政维度', '',a.subcompanyname,null,'',
|
|
|
|
|
'',NULL,'','','',isnull(a.supsubcomid,0),isnull(a.supsubcomid,0),
|
|
|
|
|
0,0,0,convert(varchar(100),getDate(),23),'2099-12-31' from hrmsubcompany as a
|
|
|
|
|
where isnull(a.canceled,0) <> 1
|
|
|
|
|
</insert>
|
|
|
|
|
<!--同步集团信息-->
|
|
|
|
|
<insert id="insertComToMap">
|
|
|
|
|
INSERT INTO jcl_org_map ( id, ftype, fobjid, uuid,fclass, fclassname, fnumber, fname,
|
|
|
|
|
fleader, fleaderimg, fleadername, fleaderjobid, fleaderjob, fparentid,fobjparentid,
|
|
|
|
|
fplan, fonjob, fisvitual, fdatebegin, fdateend)
|
|
|
|
|
SELECT 0, 0, 0, uuid, 0, '行政维度', '00', companyname,
|
|
|
|
|
0, NULL, NULL, 0, NULL, -1, 0,
|
|
|
|
|
0, 0, 0, convert(varchar(100),getDate(),23), '2099-12-31' FROM hrmcompany
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
</mapper>
|