diff --git a/docs/非标从发SQL脚本/SqlServer.sql b/docs/非标从发SQL脚本/SqlServer.sql index 680dad19..209661b9 100644 --- a/docs/非标从发SQL脚本/SqlServer.sql +++ b/docs/非标从发SQL脚本/SqlServer.sql @@ -60,7 +60,7 @@ update jcl_org_comp set ec_company = ( select eccompany from ( select DISTINCT b update JCL_ORG_DEPT set ec_department = ( select ecdepartment from ( select DISTINCT b.id as parent_dept, c.id as ecdepartment from JCL_ORG_DEPT a inner join JCL_ORG_DEPT b on a.parent_dept = b.id inner join hrmdepartment c on b.uuid = c.uuid ) e where JCL_ORG_DEPT.parent_dept = e.parent_dept ); update JCL_ORG_DEPT set ec_company = ( select eccompany from ( select a.id as id, c.id as eccompany from jcl_org_comp a inner join hrmsubcompany c on a.uuid = c.uuid) e where JCL_ORG_DEPT.parent_comp = e.id ); -- 更新人员jobtitle -update hrmresource set jobtitle = ( select id from HRMJOBTITLES where JOBTITLENAME = ( select JOB_NAME from jcl_org_job where id = ( select FIELD100002 from CUS_FIELDDATA where scope = 'HrmCustomFieldByInfoType' and SCOPEID = '-1' and CUS_FIELDDATA.ID = hrmresource.ID))); +update hrmresource set jobtitle = ( select top 1 id from HRMJOBTITLES where JOBTITLENAME = ( select JOB_NAME from jcl_org_job where id = ( select FIELD100002 from CUS_FIELDDATA where scope = 'HrmCustomFieldByInfoType' and SCOPEID = '-1' and CUS_FIELDDATA.ID = hrmresource.ID))); -- 更新岗位ec_company、ec_department update jcl_org_job set ec_company = (select eccompany from ( select a.id as id, c.id as eccompany from jcl_org_comp a inner join hrmsubcompany c on a.uuid = c.uuid) e where jcl_org_job.parent_comp = e.id ); update jcl_org_job set ec_department = ( select ec_department from ( select a.id as id, c.id as ec_department from jcl_org_dept a inner join hrmdepartment c on a.uuid = c.uuid) e where jcl_org_job.parent_dept = e.id ); diff --git a/src/com/engine/organization/mapper/hrmresource/SystemDataMapper.xml b/src/com/engine/organization/mapper/hrmresource/SystemDataMapper.xml index c73897e8..3fb1909b 100644 --- a/src/com/engine/organization/mapper/hrmresource/SystemDataMapper.xml +++ b/src/com/engine/organization/mapper/hrmresource/SystemDataMapper.xml @@ -115,6 +115,20 @@ select * from hrmjobtitles where jobtitlename = #{name} + order by created desc limit 1 + + +