@ -249,7 +277,7 @@ public class ChartServiceImpl extends Service implements ChartService {
if(hasVirtualFields){
sql="select a.id,a.departmentname as name,b.bmfzr,b.bmlx as isvitual from "+DEPARTMENT_TABLE+" a left join hrmdepartmentdefined b on a.id = b.deptid where a.id = '"+departmentId+"'";
}else{
sql="select a.id,a.departmentname as name,b.bmfzr from " +DEPARTMENT_TABLE+" a left join hrmdepartmentdefined b on a.id = b.deptid where a.id = '"+departmentId+"'";
sql="select a.id,a.departmentmark as name,b.bmfzr from " +DEPARTMENT_TABLE+" a left join hrmdepartmentdefined b on a.id = b.deptid where a.id = '"+departmentId+"'";
}
}else{
if(hasVirtualFields){
@ -270,11 +298,28 @@ public class ChartServiceImpl extends Service implements ChartService {
@ -299,7 +344,7 @@ public class ChartServiceImpl extends Service implements ChartService {
// 遍历岗位、查询对应岗位下的人员
if(isRealTime){
if(isRealDimension){
sql="select a.id,a.lastname as name ,a.belongto ,a.companyworkyear from hrmresource a where a.status < 4 and a.departmentid = ? and a.jobtitle = ?";
sql="select a.id,a.lastname as name ,a.belongto ,a.companyworkyear,b."+levelFieldId+" as levelvalue from hrmresource a left join cus_fielddata b on a.id = b.id and scopeid = 3 where a.status < 4 and a.departmentid = ? and a.jobtitle = ?";
}else{
sql="select a.id,a.lastname as name ,a.belongto ,a.companyworkyear from hrmresource a inner join hrmresourcevirtual b on a.id = b.resourceid where a.status < 4 and b.departmentid = ? and a.jobtitle = ?";
}
@ -311,7 +356,7 @@ public class ChartServiceImpl extends Service implements ChartService {
sql="select a.id,a.lastname as name ,a.belongto ,a.companyworkyear from hrmresource a where a.status < 4 and a.departmentid = ? ";
sql="select a.id,a.lastname as name ,a.belongto ,a.companyworkyear,a.managerid,b."+levelFieldId+" as levelvalue from hrmresource a left join cus_fielddata b on a.id = b.id and scopeid = 3 where a.status < 4 and a.departmentid = ? ";
}else{
sql="select a.id,a.lastname as name ,a.belongto ,a.companyworkyear from hrmresource a inner join hrmresourcevirtual b on a.id = b.resourceid where a.status < 4 and b.departmentid = ? ";
//v4 汇报关系类型获取
rs.executeQuery("select hbgxlx from uf_wdlj where wd = ?",dimension);
sql="select a.id,a.lastname as name ,a.belongto ,a.companyworkyear,a.managerid,c."+levelFieldId+" as levelvalue from hrmresource a inner join hrmresourcevirtual b on a.id = b.resourceid "+
" left join cus_fielddata c on b.resourceid = c.id and scopeid = 3 where a.status < 4 and b.departmentid = 99999";
sql="select a.id,a.lastname as name ,a.belongto ,a.companyworkyear,a.managerid,c."+levelFieldId+" as levelvalue from hrmresource a inner join hrmresourcevirtual b on a.id = b.resourceid "+
" left join cus_fielddata c on b.resourceid = c.id and scopeid = 3 where a.status < 4 and b.departmentid in ("+join+")";
sql="select a.id,a.lastname as name ,a.belongto ,a.companyworkyear,c."+professionalSuperId+" as managerid, c."+levelFieldId+" as levelvalue from hrmresource a inner join hrmresourcevirtual b on a.id = b.resourceid "+
" left join cus_fielddata c on b.resourceid = c.id and scopeid = 3 where a.status < 4 and b.departmentid in ("+join+")";
}elseif("2".equals(hbgxlx)){
//仅展示本部门
sql="select a.id,a.lastname as name ,a.belongto ,a.companyworkyear,a.managerid,c."+levelFieldId+" as levelvalue from hrmresource a inner join hrmresourcevirtual b on a.id = b.resourceid "+
" left join cus_fielddata c on b.resourceid = c.id and scopeid = 3 where a.status < 4 and b.departmentid = "+departmentId;
}
rs.executeQuery(sql);
}
}else{
sql="select a.resourceid as id,a.lastname as name ,a.belongto ,a.companyworkyear from jcl_chart_resource a where a.status < 4 and a.departmentid = ? and versionid = "+versionId;
sql="select a.resourceid as id,a.lastname as name ,a.belongto ,a.companyworkyear,a.manager from jcl_chart_resource a where a.status < 4 and a.departmentid = ? and versionid = " +versionId;
Stringsql="select id as id, id as value, departmentname as title, subcompanyid1 as pId from hrmdepartmentvirtual where (canceled is null or canceled != '1') and (supdepid is null or supdepid =0) and"+dbType.ifNull("subcompanyid1","0")+" = "+subCompany;
sql="select id as id, id as value, departmentname as title, supdepid as pId from hrmdepartmentvirtual where (canceled is null or canceled != '1') and "+dbType.ifNull("supdepid","0")+" = ?";
@ -1280,7 +1473,8 @@ public class ChartServiceImpl extends Service implements ChartService {
}
}else{
return"select a.id,a.subcompanyname as name,'1' as type,b.on_job_num,b.staff_num from "+SUB_COMPANY_TABLE+" a left join jcl_org_onjob b on a.id=b.data_id and b.type=1 where a.id = '"+root+"' order by a.showorder,a.id";
//return "select a.id,a.subcompanyname as name,'1' as type,b.on_job_num,b.staff_num from " + SUB_COMPANY_TABLE + " a left join jcl_org_onjob b on a.id=b.data_id and b.type=1 where a.id = '" + root + "' order by a.showorder,a.id";
return"select a.id,a.departmentname as name,'2' as type,b.on_job_num,b.staff_num from "+DEPARTMENT_TABLE+" a left join jcl_org_onjob b on a.id=b.data_id and b.type=2 where a.id = '"+department+"' order by a.showorder,a.id";
}
}
}
@ -1320,14 +1514,14 @@ public class ChartServiceImpl extends Service implements ChartService {
if(hasVirtualFields){
if(showVirtual){
sql="select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual,showorder,c.on_job_num,c.staff_num from "+SUB_COMPANY_TABLE+" a left join "+SUB_COMPANY_DEFINED_TABLE+" b on a.id = b.subcomid left join jcl_org_onjob c on a.id=c.data_id and c.type=1 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,showorder,c.on_job_num,c.staff_num from " +DEPARTMENT_TABLE+" a left join "+DEPARTMENT_DEFINED_TABLE+" b on a.id = b.deptid left join jcl_org_onjob c on a.id=c.data_id and c.type=2 where (a.canceled is null or a.canceled != '1') and (a.supdepid is null or a.supdepid = '0') and subcompanyid1 = '"+fObjId+"'";
" union select a.id,a.departmentmark as name,'2' as type ,b.bmlx as isvitual,showorder,c.on_job_num,c.staff_num from " +DEPARTMENT_TABLE+" a left join "+DEPARTMENT_DEFINED_TABLE+" b on a.id = b.deptid left join jcl_org_onjob c on a.id=c.data_id and c.type=2 where (a.canceled is null or a.canceled != '1') and (a.supdepid is null or a.supdepid = '0') and subcompanyid1 = '"+fObjId+"'";
}else{
sql="select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual,showorder,c.on_job_num,c.staff_num from "+SUB_COMPANY_TABLE+" a left join "+SUB_COMPANY_DEFINED_TABLE+" b on a.id = b.subcomid left join jcl_org_onjob c on a.id=c.data_id and c.type=1 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,showorder,c.on_job_num,c.staff_num from "+DEPARTMENT_TABLE+" a left join "+DEPARTMENT_DEFINED_TABLE+" b on a.id = b.deptid left join jcl_org_onjob c on a.id=c.data_id and c.type=2 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{
sql="select a.id,a.subcompanyname as name,'1' as type,showorder,b.on_job_num,b.staff_num from "+SUB_COMPANY_TABLE+" a left join jcl_org_onjob b on a.id=b.data_id and b.type=1 where (canceled is null or canceled != '1') and supsubcomid = '"+fObjId+"'"+
" union select a.id,a.departmentname as name,'2' as type,showorder,b.on_job_num,b.staff_num from " +DEPARTMENT_TABLE+" a left join jcl_org_onjob b on a.id=b.data_id and b.type=2 where (canceled is null or canceled != '1') and (supdepid is null or supdepid = '0') and subcompanyid1 = '"+fObjId+"'";
" union select a.id,a.departmentmark as name,'2' as type,showorder,b.on_job_num,b.staff_num from " +DEPARTMENT_TABLE+" a left join jcl_org_onjob b on a.id=b.data_id and b.type=2 where (canceled is null or canceled != '1') and (supdepid is null or supdepid = '0') and subcompanyid1 = '"+fObjId+"'";
}
break;
case"2":
@ -1338,7 +1532,7 @@ public class ChartServiceImpl extends Service implements ChartService {
sql="select a.id,a.departmentname as name,'2' as type ,b.bmlx as isvitual,c.on_job_num,c.staff_num from "+DEPARTMENT_TABLE+" a left join hrmdepartmentdefined b on a.id = b.deptid left join jcl_org_onjob c on a.id=c.data_id and c.type=2 where (canceled is null or canceled != '1') and (b.bmlx is null or b.bmlx != '1') and a.supdepid = '"+fObjId+"'";
}
}else{
sql="select a.id,a.departmentname as name,'2' as type,b.on_job_num,b.staff_num from " +DEPARTMENT_TABLE+" a left join jcl_org_onjob b on a.id=b.data_id and b.type=2 where (canceled is null or canceled != '1') and supdepid = '"+fObjId+"'";
sql="select a.id,a.departmentmark as name,'2' as type,b.on_job_num,b.staff_num from " +DEPARTMENT_TABLE+" a left join jcl_org_onjob b on a.id=b.data_id and b.type=2 where (canceled is null or canceled != '1') and supdepid = '"+fObjId+"'";
}
break;
default:
@ -1439,10 +1633,16 @@ public class ChartServiceImpl extends Service implements ChartService {
Stringsql="select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompany where (canceled is null or canceled != '1') and "+DBType.get(newRecordSet().getDBType()).ifNull("supsubcomid","0")+" = '0'";
companyTree.add(CompanyTreePO.builder().id(rs.getString("id")).pId(rs.getString("pId")).value(rs.getString("value")).title(rs.getString("title")).isLeaf(judgeTreeLeaf("select id from hrmsubcompany where (canceled is null or canceled != '1') and supsubcomid = ?",rs.getString("id"))).build());
}
result.put("api_status",true);
result.put("fclasslist",fclasslist);
result.put("companyTree",companyTree);
@ -116,7 +114,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
sql="select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompanyvirtual where (canceled is null or canceled != '1') and " +DBType.get(newRecordSet().getDBType()).ifNull("supsubcomid","0")+" = ? and companyid = '"+fclass+"'";
sql="select id as id, id as value, subcompanyname as title, supsubcomid as pId,showorder from hrmsubcompanyvirtual where (canceled is null or canceled != '1') and " +DBType.get(newRecordSet().getDBType()).ifNull("supsubcomid","0")+" = ? and companyid = '"+fclass+"'";
}
}else{
sql="select subcompanyid as id, id as value, subcompanyname as title, supsubcompanyid as pId from jcl_chart_subcompany where (canceled is null or canceled != '1') and "+DBType.get(newRecordSet().getDBType()).ifNull("supsubcompanyid","0")+" = ? ";
@ -129,8 +127,11 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {