rs.executeQuery("select a.id,a.subcompanyname as 'name','1' as 'type' ,b.fblx as 'isvitual' from "+SUB_COMPANY_TABLE+" a left join "+SUB_COMPANY_DEFINED_TABLE+" b on a.id = b.subcomid where (a.canceled is null or a.canceled != '1') and a.supsubcomid = '"+fObjId+"'"+
" union select a.id,a.departmentname as 'name','2' as 'type' ,b.bmlx as 'isvitual' from "+DEPARTMENT_TABLE+" a left join "+DEPARTMENT_DEFINED_TABLE+" b on a.id = b.deptid where (a.canceled is null or a.canceled != '1') and (a.supdepid is null or a.supdepid = '0') and subcompanyid1 = '"+fObjId+"'");
}else{
rs.executeQuery("select a.id,a.subcompanyname as 'name','1' as 'type' ,b.fblx as 'isvitual' from "+SUB_COMPANY_TABLE+" a left join "+SUB_COMPANY_DEFINED_TABLE+" b on a.id = b.subcomid where (a.canceled is null or a.canceled != '1') and (b.fblx is null or b.fblx != '1') and a.supsubcomid = '"+fObjId+"'"+
" union select a.id,a.departmentname as 'name','2' as 'type' ,b.bmlx as 'isvitual' from "+DEPARTMENT_TABLE+" a left join "+DEPARTMENT_DEFINED_TABLE+" b on a.id = b.deptid where (a.canceled is null or a.canceled != '1') and (a.supdepid is null or a.supdepid = '0') and (b.bmlx is null or b.bmlx != '1') and subcompanyid1 = '"+fObjId+"'");
}
}else{
rs.executeQuery("select a.id,a.subcompanyname as 'name','1' as 'type' from "+SUB_COMPANY_TABLE+" a where (canceled is null or canceled != '1') and supsubcomid = '"+fObjId+"'"+
" union select a.id,a.departmentname as 'name','2' as 'type' from "+DEPARTMENT_TABLE+" a where (canceled is null or canceled != '1') and (supdepid is null or supdepid = '0') and subcompanyid1 = '"+fObjId+"'");
}
}elseif(s.startsWith("d")){
if(hasVirtualFields){
if(showVirtual){
rs.executeQuery("select a.id,a.departmentname as 'name','2' as 'type' ,b.bmlx as 'isvitual' from "+DEPARTMENT_TABLE+" a left join "+DEPARTMENT_DEFINED_TABLE+" b on a.id = b.deptid where (a.canceled is null or a.canceled != '1') and supdepid = '"+fObjId+"'");
}else{
rs.executeQuery("select a.id,a.departmentname as 'name','2' as 'type' ,b.bmlx as 'isvitual' from "+DEPARTMENT_TABLE+" a left join hrmdepartmentdefined b on a.id = b.deptid where (canceled is null or canceled != '1') and (b.bmlx is null or b.bmlx != '1') and a.supdepid = '"+fObjId+"'");
}
}else{
rs.executeQuery("select a.id,a.departmentname as 'name','2' as 'type' from "+DEPARTMENT_TABLE+" a where (canceled is null or canceled != '1') and supdepid = '"+fObjId+"'");
@ -553,7 +553,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
// 更新岗位组织架构图
// 更新岗位组织架构图
//for (JobPO jobPO : firstChildJobList) {
//for (JobPO jobPO : firstChildJobList) {
// // 刷新组织架构图
// // 刷新组织架构图
// TODO new JobTriggerRunnable(jobPO.getId()).run();
// new JobTriggerRunnable(jobPO.getId()).run();
//}
//}
// 更新当前部门下的人员
// 更新当前部门下的人员
rs.executeUpdate("update hrmresource set SUBCOMPANYID1 =?,DEPARTMENTID =? where DEPARTMENTID =?",targetDepartment.getSubCompanyId1(),targetEcDeptId,mergeEcDeptId);
rs.executeUpdate("update hrmresource set SUBCOMPANYID1 =?,DEPARTMENTID =? where DEPARTMENTID =?",targetDepartment.getSubCompanyId1(),targetEcDeptId,mergeEcDeptId);
@ -561,7 +561,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService