|
|
@ -74,4 +74,55 @@
|
|
|
|
<select id="getJclOrgMapByType" resultType="com.engine.organization.entity.map.JclOrgMap">
|
|
|
|
<select id="getJclOrgMapByType" resultType="com.engine.organization.entity.map.JclOrgMap">
|
|
|
|
select * from jcl_org_map where ftype = #{fType} AND FDATEBEGIN <= #{currentDate} AND FDATEEND >= #{currentDate}
|
|
|
|
select * from jcl_org_map where ftype = #{fType} AND FDATEBEGIN <= #{currentDate} AND FDATEEND >= #{currentDate}
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--删除当天所有数据-->
|
|
|
|
|
|
|
|
<delete id="deleteAllMap">
|
|
|
|
|
|
|
|
delete from jcl_org_map where fdatebegin = #{currentDate}
|
|
|
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<!--修改所有失效日期-->
|
|
|
|
|
|
|
|
<update id="updateAllMap">
|
|
|
|
|
|
|
|
update jcl_org_map
|
|
|
|
|
|
|
|
<set>
|
|
|
|
|
|
|
|
fdateend=#{yesterday},
|
|
|
|
|
|
|
|
</set>
|
|
|
|
|
|
|
|
where fdateend > #{currentDate}
|
|
|
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<!--初始化人员数据-->
|
|
|
|
|
|
|
|
<insert id="insertResToMap" databaseId="sqlserver">
|
|
|
|
|
|
|
|
insert into jcl_org_map
|
|
|
|
|
|
|
|
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleaderimg,
|
|
|
|
|
|
|
|
fleaderjobid,fleaderjob,fleaderlv,fleaderst,fparentid,fobjparentid,
|
|
|
|
|
|
|
|
fisvitual,fdatebegin,fdateend)
|
|
|
|
|
|
|
|
select a.id+300000000,4,a.id,a.uuid,0,'行政维度',a.workcode,a.LASTNAME,a.messagerurl,
|
|
|
|
|
|
|
|
c.id,c.jobtitlename,null,null, 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 HrmJobTitles c on b.ec_jobTitle = c.id
|
|
|
|
|
|
|
|
where a.status < 4
|
|
|
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<!--初始化岗位-->
|
|
|
|
|
|
|
|
<insert id="insertJobToMap">
|
|
|
|
|
|
|
|
insert into jcl_org_map
|
|
|
|
|
|
|
|
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,
|
|
|
|
|
|
|
|
fparentid,fobjparentid,
|
|
|
|
|
|
|
|
fplan,fonjob,fisvitual,fdatebegin,fdateend)
|
|
|
|
|
|
|
|
select a.id+200000000,3,a.id,g.uuid,0,'行政维度',a.job_no,g.jobtitlename,
|
|
|
|
|
|
|
|
ec_department+100000000,
|
|
|
|
|
|
|
|
ec_department,
|
|
|
|
|
|
|
|
isnull(e.fcnt,0),isnull(f.fcnt,0),0,convert(varchar(100),getDate(),23),'2099-12-31'
|
|
|
|
|
|
|
|
from JCL_ORG_job as a
|
|
|
|
|
|
|
|
left join (select job_id,sum(isnull(staff_num,0)) fcnt from JCL_ORG_STAFF
|
|
|
|
|
|
|
|
where plan_id in (select id from JCL_ORG_STAFFPLAN
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper>
|
|
|
|
</mapper>
|