|
|
|
@ -86,6 +86,7 @@
|
|
|
|
|
</set>
|
|
|
|
|
where fdateend > #{currentDate}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<!--初始化人员数据-->
|
|
|
|
|
<insert id="insertResToMap" databaseId="sqlserver">
|
|
|
|
|
insert into jcl_org_map
|
|
|
|
@ -96,11 +97,11 @@
|
|
|
|
|
c.id,c.jobtitlename,e.level_name,f.grade_name, isnull( b.id, '' ) +200000000,b.id,
|
|
|
|
|
0,convert(varchar(100),getDate(),23),'2099-12-31'
|
|
|
|
|
from hrmresource a
|
|
|
|
|
left join jcl_org_job b ON a.JOBTITLE = b.ec_jobTitle
|
|
|
|
|
left join jcl_org_job b ON a.JOBTITLE = b.ec_jobTitle and a.subcompanyid1=b.ec_company and a.departmentid=b.ec_department
|
|
|
|
|
left join HrmJobTitles c on b.ec_jobTitle = c.id
|
|
|
|
|
left join cus_fielddata d on a.id = d.id and d.scope='HrmCustomFieldByInfoType' and d.scopeid=3
|
|
|
|
|
left join jcl_org_level e on d.field3=e.id
|
|
|
|
|
left join jcl_org_grade f on d.field4=f.id
|
|
|
|
|
left join jcl_org_level e on d.${level}=e.id
|
|
|
|
|
left join jcl_org_grade f on d.${grade}=f.id
|
|
|
|
|
where a.status < 4
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="insertResToMap" databaseId="mysql">
|
|
|
|
@ -112,14 +113,14 @@
|
|
|
|
|
c.id,c.jobtitlename,e.level_name,f.grade_name, ifnull( b.id, '' ) +200000000,b.id,
|
|
|
|
|
0,NOW(),'2099-12-31'
|
|
|
|
|
from hrmresource a
|
|
|
|
|
left join jcl_org_job b ON a.JOBTITLE = b.ec_jobTitle
|
|
|
|
|
left join jcl_org_job b ON a.JOBTITLE = b.ec_jobTitle and a.subcompanyid1=b.ec_company and a.departmentid=b.ec_department
|
|
|
|
|
left join HrmJobTitles c on b.ec_jobTitle = c.id
|
|
|
|
|
left join cus_fielddata d on a.id = d.id and d.scope='HrmCustomFieldByInfoType' and d.scopeid=3
|
|
|
|
|
left join jcl_org_level e on d.field3=e.id
|
|
|
|
|
left join jcl_org_grade f on d.field4=f.id
|
|
|
|
|
left join jcl_org_level e on d.${level}=e.id
|
|
|
|
|
left join jcl_org_grade f on d.${grade}=f.id
|
|
|
|
|
where a.status < 4
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="insertResToMap" databaseId="oracle">
|
|
|
|
|
<insert id="insertResToMap" parameterType="java.lang.String" databaseId="oracle">
|
|
|
|
|
insert into jcl_org_map
|
|
|
|
|
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleaderimg,
|
|
|
|
|
fleaderjobid,fleaderjob,fleaderlv,fleaderst,fparentid,fobjparentid,
|
|
|
|
@ -131,8 +132,8 @@
|
|
|
|
|
left join jcl_org_job b ON a.JOBTITLE = b.ec_jobTitle and a.subcompanyid1=b.ec_company and a.departmentid=b.ec_department
|
|
|
|
|
left join HrmJobTitles c on b.ec_jobTitle = c.id
|
|
|
|
|
left join cus_fielddata d on a.id = d.id and d.scope='HrmCustomFieldByInfoType' and d.scopeid=3
|
|
|
|
|
left join jcl_org_level e on d.field3=e.id
|
|
|
|
|
left join jcl_org_grade f on d.field4=f.id
|
|
|
|
|
left join jcl_org_level e on ${level}=e.id
|
|
|
|
|
left join jcl_org_grade f on ${grade}=f.id
|
|
|
|
|
where a.status < 4
|
|
|
|
|
</insert>
|
|
|
|
|
<!--初始化岗位-->
|
|
|
|
@ -169,9 +170,11 @@
|
|
|
|
|
where plan_id in (select id from JCL_ORG_STAFFPLAN
|
|
|
|
|
where time_start<=NOW() and time_end > NOW() 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.ec_jobTitle
|
|
|
|
|
left join ( select c.id,count(1) fcnt from hrmresource a
|
|
|
|
|
left join Hrmjobtitles b on a.jobtitle=b.id
|
|
|
|
|
left join jcl_org_job c on b.id=c.ec_jobtitle and a.subcompanyid1=c.ec_company and a.departmentid=c.ec_department
|
|
|
|
|
group by c.id) f
|
|
|
|
|
on f.id=a.id
|
|
|
|
|
left join HrmJobTitles g on a.ec_jobTitle = g.id
|
|
|
|
|
where ifnull(a.delete_type,0) <> 1 and ifnull(a.forbidden_tag,0) <> 1
|
|
|
|
|
</insert>
|
|
|
|
@ -214,8 +217,8 @@
|
|
|
|
|
left join hrmresource as c on cast(b.BMFZR as varchar(10))=cast(c.ID as varchar(10))
|
|
|
|
|
left join hrmjobtitles as d on c.JOBTITLE=d.id
|
|
|
|
|
left join cus_fielddata e on c.id = e.id and e.scope='HrmCustomFieldByInfoType' and e.scopeid=3
|
|
|
|
|
left join jcl_org_level f on e.field3=f.id
|
|
|
|
|
left join jcl_org_grade g on e.field4=g.id
|
|
|
|
|
left join jcl_org_level f on e.${level}=f.id
|
|
|
|
|
left join jcl_org_grade g on e.${grade}=g.id
|
|
|
|
|
where isnull(a.canceled,0) <> 1
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="insertDeptToMap" databaseId="mysql">
|
|
|
|
@ -234,8 +237,8 @@
|
|
|
|
|
left join hrmresource as c on b.BMFZR=c.ID
|
|
|
|
|
left join hrmjobtitles as d on c.JOBTITLE=d.id
|
|
|
|
|
left join cus_fielddata e on c.id = e.id and e.scope='HrmCustomFieldByInfoType' and e.scopeid=3
|
|
|
|
|
left join jcl_org_level f on e.field3=f.id
|
|
|
|
|
left join jcl_org_grade g on e.field4=g.id
|
|
|
|
|
left join jcl_org_level f on e.${level}=f.id
|
|
|
|
|
left join jcl_org_grade g on e.${grade}=g.id
|
|
|
|
|
where ifnull(a.canceled,0) <> 1
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="insertDeptToMap" databaseId="oracle">
|
|
|
|
@ -253,8 +256,8 @@
|
|
|
|
|
left join hrmresource c on to_char(b.BMFZR)=c.ID
|
|
|
|
|
left join hrmjobtitles d on c.JOBTITLE=d.id
|
|
|
|
|
left join cus_fielddata e on c.id = e.id and e.scope='HrmCustomFieldByInfoType' and e.scopeid=3
|
|
|
|
|
left join jcl_org_level f on e.field3=f.id
|
|
|
|
|
left join jcl_org_grade g on e.field4=g.id
|
|
|
|
|
left join jcl_org_level f on e.${level}=f.id
|
|
|
|
|
left join jcl_org_grade g on e.${grade}=g.id
|
|
|
|
|
where nvl(a.canceled,0) <> 1
|
|
|
|
|
</insert>
|
|
|
|
|
<!--同步分部信息-->
|
|
|
|
|