insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547469asindexid,'The frozen number cannot be greater than the remaining prepare number!'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547469andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547470asindexid,'Under the strong control strategy, please release the current frozen amount before completing the onboarding operation'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547470andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547471asindexid,'Overloading is not allowed under the strong control strategy'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547471andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547472asindexid,'The adjustment quantity cannot be greater than the current number'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547472andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547474asindexid,'The organization''s prepare information under the corresponding prepare scheme is not Query'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547474andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547949asindexid,'The current frozen number is 0, no need to release it'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547949andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547469asindexid,'The frozen number cannot be greater than the remaining prepare number!'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547469andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547470asindexid,'Under the strong control strategy, please release the current frozen amount before completing the onboarding operation'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547470andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547471asindexid,'Overloading is not allowed under the strong control strategy'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547471andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547472asindexid,'The adjustment quantity cannot be greater than the current number'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547472andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547474asindexid,'The organization''s prepare information under the corresponding prepare scheme is not Query'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547474andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547949asindexid,'The current frozen number is 0, no need to release it'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547949andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547469asindexid,'The frozen number cannot be greater than the remaining prepare number!'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547469andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547470asindexid,'Under the strong control strategy, please release the current frozen amount before completing the onboarding operation'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547470andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547471asindexid,'Overloading is not allowed under the strong control strategy'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547471andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547472asindexid,'The adjustment quantity cannot be greater than the current number'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547472andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547474asindexid,'The organization''s prepare information under the corresponding prepare scheme is not Query'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547474andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547949asindexid,'The current frozen number is 0, no need to release it'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547949andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547469asindexid,'The frozen number cannot be greater than the remaining prepare number!'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547469andlanguageid=8and(labelnameisnotnullandlabelname<>''andlength(labelname)=char_length(labelname)))limit1
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547470asindexid,'Under the strong control strategy, please release the current frozen amount before completing the onboarding operation'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547470andlanguageid=8and(labelnameisnotnullandlabelname<>''andlength(labelname)=char_length(labelname)))limit1
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547471asindexid,'Overloading is not allowed under the strong control strategy'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547471andlanguageid=8and(labelnameisnotnullandlabelname<>''andlength(labelname)=char_length(labelname)))limit1
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547472asindexid,'The adjustment quantity cannot be greater than the current number'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547472andlanguageid=8and(labelnameisnotnullandlabelname<>''andlength(labelname)=char_length(labelname)))limit1
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547474asindexid,'The organization''s prepare information under the corresponding prepare scheme is not Query'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547474andlanguageid=8and(labelnameisnotnullandlabelname<>''andlength(labelname)=char_length(labelname)))limit1
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547949asindexid,'The current frozen number is 0, no need to release it'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547949andlanguageid=8and(labelnameisnotnullandlabelname<>''andlength(labelname)=char_length(labelname)))limit1
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547469asindexid,'The frozen number cannot be greater than the remaining prepare number!'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547469andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547470asindexid,'Under the strong control strategy, please release the current frozen amount before completing the onboarding operation'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547470andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547471asindexid,'Overloading is not allowed under the strong control strategy'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547471andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547472asindexid,'The adjustment quantity cannot be greater than the current number'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547472andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547474asindexid,'The organization''s prepare information under the corresponding prepare scheme is not Query'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547474andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547949asindexid,'The current frozen number is 0, no need to release it'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547949andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547469asindexid,'The frozen number cannot be greater than the remaining prepare number!'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547469andlanguageid=8and(labelnameisnotnullandlabelname<>''andlength(labelname)=octet_length(labelname)))limit1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547470asindexid,'Under the strong control strategy, please release the current frozen amount before completing the onboarding operation'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547470andlanguageid=8and(labelnameisnotnullandlabelname<>''andlength(labelname)=octet_length(labelname)))limit1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547471asindexid,'Overloading is not allowed under the strong control strategy'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547471andlanguageid=8and(labelnameisnotnullandlabelname<>''andlength(labelname)=octet_length(labelname)))limit1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547472asindexid,'The adjustment quantity cannot be greater than the current number'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547472andlanguageid=8and(labelnameisnotnullandlabelname<>''andlength(labelname)=octet_length(labelname)))limit1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547474asindexid,'The organization''s prepare information under the corresponding prepare scheme is not Query'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547474andlanguageid=8and(labelnameisnotnullandlabelname<>''andlength(labelname)=octet_length(labelname)))limit1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547949asindexid,'The current frozen number is 0, no need to release it'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547949andlanguageid=8and(labelnameisnotnullandlabelname<>''andlength(labelname)=octet_length(labelname)))limit1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(selecttop1547469asindexid,'The frozen number cannot be greater than the remaining prepare number!'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547469andlanguageid=8and(labelnameisnotnullandlabelname<>''andlabelnamenotlike'%[吖-座]%'))
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(selecttop1547470asindexid,'Under the strong control strategy, please release the current frozen amount before completing the onboarding operation'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547470andlanguageid=8and(labelnameisnotnullandlabelname<>''andlabelnamenotlike'%[吖-座]%'))
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(selecttop1547471asindexid,'Overloading is not allowed under the strong control strategy'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547471andlanguageid=8and(labelnameisnotnullandlabelname<>''andlabelnamenotlike'%[吖-座]%'))
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(selecttop1547472asindexid,'The adjustment quantity cannot be greater than the current number'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547472andlanguageid=8and(labelnameisnotnullandlabelname<>''andlabelnamenotlike'%[吖-座]%'))
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(selecttop1547474asindexid,'The organization''s prepare information under the corresponding prepare scheme is not Query'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547474andlanguageid=8and(labelnameisnotnullandlabelname<>''andlabelnamenotlike'%[吖-座]%'))
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(selecttop1547949asindexid,'The current frozen number is 0, no need to release it'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547949andlanguageid=8and(labelnameisnotnullandlabelname<>''andlabelnamenotlike'%[吖-座]%'))
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547469asindexid,'The frozen number cannot be greater than the remaining prepare number!'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547469andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547470asindexid,'Under the strong control strategy, please release the current frozen amount before completing the onboarding operation'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547470andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547471asindexid,'Overloading is not allowed under the strong control strategy'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547471andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547472asindexid,'The adjustment quantity cannot be greater than the current number'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547472andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547474asindexid,'The organization''s prepare information under the corresponding prepare scheme is not Query'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547474andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
insertintoHtmlLabelInfo(indexid,labelname,languageid)select*from(select547949asindexid,'The current frozen number is 0, no need to release it'ascontent,8aslanguageidfromHtmlLabelInfo)twherenotexists(selectindexid,languageidfromHtmlLabelInfowhereindexid=547949andlanguageid=8and(trim(labelname)isnotnullandlength(labelname)=lengthb(labelname)))andrownum=1;
@ -461,14 +466,31 @@ public class ChartServiceImpl extends Service implements ChartService {
" versionid = "+versionId+" and companyvirtualid = "+dimension;
}
}else{
if(hasVirtualFields){
if(showVirtual){
return"select "+SUB_COMPANY_ID+" as id,subcompanyname as name,'1' as type,isvirtual as isvitual,a.job_num,a.staff_num from "+SUB_COMPANY_TABLE+" a where versionid = "+versionId+" and subcompanyid = "+root;
StringnumSql=",a.job_num,a.staff_num";
if(!isRealDimension){
numSql="";
}
if(root.startsWith("d")){
root=root.replace("d","");
if(hasVirtualFields){
if(showVirtual){
return"select "+DEPARTMENT_ID+" as id,a.departmentname as name,'2' as type ,isvirtual as isvitual"+numSql+" from "+DEPARTMENT_TABLE+" a where (a.canceled is null or a.canceled != '1') and "+DEPARTMENT_ID+" = '"+root+"' and versionid = "+versionId;
}else{
return"select "+DEPARTMENT_ID+" as id,a.departmentname as name,'2' as type ,isvirtual as isvitual"+numSql+" from "+DEPARTMENT_TABLE+" a where (canceled is null or canceled != '1') and (isvirtual is null or isvirtual != '1') and "+DEPARTMENT_ID+" = '"+root+"' and versionid = "+versionId;
}
}else{
return"select "+SUB_COMPANY_ID+" as id,subcompanyname as name,'1' as type,isvirtual as isvitual,a.job_num,a.staff_num from "+SUB_COMPANY_TABLE+" a where versionid = "+versionId+" and subcompanyid = "+root+" and (isvirtual is null or isvirtual != '1')";
return"select "+DEPARTMENT_ID +" as id,a.departmentname as name,'2' as type"+numSql+" from "+DEPARTMENT_TABLE+" a where (canceled is null or canceled != '1') and "+DEPARTMENT_ID+" = '"+root+"' and versionid = "+versionId;
}
}else{
return"select "+SUB_COMPANY_ID+" as id,subcompanyname as name,'1' as type,a.job_num,a.staff_num from "+SUB_COMPANY_TABLE+" a where versionid = "+versionId+" and subcompanyid = "+root;
if(hasVirtualFields){
if(showVirtual){
return"select "+SUB_COMPANY_ID+" as id,subcompanyname as name,'1' as type,isvirtual as isvitual"+numSql+" from "+SUB_COMPANY_TABLE+" a where versionid = "+versionId+" and "+SUB_COMPANY_ID+" = "+root;
}else{
return"select "+SUB_COMPANY_ID+" as id,subcompanyname as name,'1' as type,isvirtual as isvitual"+numSql+" from "+SUB_COMPANY_TABLE+" a where versionid = "+versionId+" and "+SUB_COMPANY_ID+" = "+root+" and (isvirtual is null or isvirtual != '1')";
}
}else{
return"select "+SUB_COMPANY_ID+" as id,subcompanyname as name,'1' as type"+numSql+" from "+SUB_COMPANY_TABLE+" a where versionid = "+versionId+" and "+SUB_COMPANY_ID+" = "+root;
}
}
}
}
@ -524,6 +546,19 @@ public class ChartServiceImpl extends Service implements ChartService {
rs.executeUpdate("delete from jcl_org_chartversion where id = ?",versionId);
//2.删除历史分部表
rs.executeUpdate("delete from jcl_chart_subcompany where versionid = ?",versionId);
//3.删除历史部门表
rs.executeUpdate("delete from jcl_chart_department where versionid = ?",versionId);
//4.删除历史聚才林岗位表
rs.executeUpdate("delete from jcl_chart_job where versionid = ?",versionId);
//5.删除历史人员表
rs.executeUpdate("delete from jcl_chart_resource where versionid = ?",versionId);
data.put("versionId",versionId);
returndata;
}
/**
*生成人数
*@paramstp
@ -1339,15 +1398,28 @@ public class ChartServiceImpl extends Service implements ChartService {
return"select id,companyname as name,'0' as type from "+COMPANY_TABLE+" where id = '"+dimension+"'";
}
}else{
if(hasVirtualFields){
if(showVirtual){
return"select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual,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.id = '"+root+"' order by showorder,id";
if(root.startsWith("d")){
root=root.replace("d","");
if(hasVirtualFields){
if(showVirtual){
return"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 "+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.id = '"+root+"'";
}else{
return"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.id = '"+root+"'";
}
}else{
return"select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual,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.id = '"+root+"' and (b.fblx is null or b.fblx!='1') order by showorder,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 (canceled is null or canceled != '1') and a.id = '"+root+"'";
}
}else{
if(hasVirtualFields){
if(showVirtual){
return"select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual,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.id = '"+root+"' order by showorder,id";
}else{
return"select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual,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.id = '"+root+"' and (b.fblx is null or b.fblx!='1') order by showorder,id";
}
}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";
}
}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";
}
}
}
@ -1654,10 +1726,10 @@ public class ChartServiceImpl extends Service implements ChartService {
@ -1665,36 +1737,37 @@ public class ChartServiceImpl extends Service implements ChartService {
subCompany=subCompany.replace("d","");
if(isSearchCurrent){
sql="select "+dbType.concat("d","id")+"as id, id as value, departmentname as title, "+dbType.concat("d","supdepid")+" as pId from hrmdepartment where (canceled is null or canceled != '1') and "+dbType.ifNull("supdepid","0")+" = "+subCompany;
if(isCurrentDimension){
sql+=" order by showorder,id ";
if(isNotCurrentDimension){
sql="select "+dbType.concat("d","id")+"as id, id as value, departmentname as title, "+dbType.concat("d","supdepid")+" as pId from hrmdepartmentvirtual where (canceled is null or canceled != '1') and "+dbType.ifNull("supdepid","0")+" = "+subCompany;
}
sql+=" order by showorder,id ";
}else{
sql="select "+dbType.concat("d","departmentid")+"as id, departmentid as value, departmentname as title, "+dbType.concat("d","supdepartmentid")+" as pId from jcl_chart_department where (canceled is null or canceled != '1') and "+dbType.ifNull("supdepartmentid","0")+" = "+subCompany;
if(isCurrentDimension){
if(isNotCurrentDimension){
sql="select "+dbType.concat("d","departmentvirtualid")+"as id, departmentvirtualid as value, departmentname as title, "+dbType.concat("d","supdepid")+" as pId from jcl_chart_departmentvirtual where (canceled is null or canceled != '1') and "+dbType.ifNull("supdepid","0")+" = "+subCompany;
}
// 添加时间轴条件
sql+=" and versionid = "+versionId;
}
}else{
// TODO 分权
if(isSearchCurrent){
sql="select "+dbType.concat("","id")+" as id, id as value, subcompanyname as title, supsubcomid as pId, showorder from hrmsubcompany where (canceled is null or canceled != '1') and "+dbType.ifNull("supsubcomid","0")+" = "+subCompany+
" union select "+dbType.concat("d","id")+"as id, id as value, departmentname as title, subcompanyid1 as pId, showorder from hrmdepartment where (canceled is null or canceled != '1') and (supdepid is null or supdepid =0) and "+dbType.ifNull("subcompanyid1","0")+" = "+subCompany;
if(isCurrentDimension){
sql+=" order by showorder,id ";
if(isNotCurrentDimension){
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.ifNull("supsubcomid","0")+" = "+subCompany+" and companyid = '"+dimension+"' "+
" union select "+dbType.concat("d","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+=" order by showorder,id ";
}else{
sql="select "+dbType.concat("","subcompanyid")+" as id, subcompanyid as value, subcompanyname as title, supsubcompanyid as pId from jcl_chart_subcompany where (canceled is null or canceled != '1') and "+dbType.ifNull("supsubcompanyid","0")+" = "+subCompany+
" union select "+dbType.concat("d","subcompanyid")+"as id, subcompanyid as value, departmentname as title, subcompanyid as pId from jcl_chart_department where (canceled is null or canceled != '1') and (supdepartmentid is null or supdepartmentid =0) and " +dbType.ifNull("subcompanyid","0")+" = "+subCompany;
if(isCurrentDimension){
sql="select "+dbType.concat("","subcompanyvirtualid")+" as id, subcompanyvirtualid as value, subcompanyname as title, supsubcompanyid as pId from jcl_chart_subcompanyvirtual where (canceled is null or canceled != '1') and "+dbType.ifNull("supsubcompanyid","0")+" = "+subCompany+" and companyid = '"+dimension+"' "+
" union select "+dbType.concat("d","departmentvirtualid")+"as id, departmentvirtualid as value, departmentname as title, subcompanyid as pId from jcl_chart_departmentvirtual where (canceled is null or canceled != '1') and (supdepid is null or supdepid =0) and"+dbType.ifNull("subcompanyid","0")+" = "+subCompany;
sql="select "+dbType.concat("","subcompanyid")+" as id, subcompanyid as value, subcompanyname as title, supsubcompanyid as pId from jcl_chart_subcompany where (canceled is null or canceled != '1') and "+dbType.ifNull("supsubcompanyid","0")+" = "+subCompany+" and versionid = "+versionId+
" union select "+dbType.concat("d","departmentid")+"as id, departmentid as value, departmentname as title, subcompanyid as pId from jcl_chart_department where (canceled is null or canceled != '1') and (supdepartmentid is null or supdepartmentid =0) and " +dbType.ifNull("subcompanyid","0")+" = "+subCompany+" and versionid = "+versionId;
if(isNotCurrentDimension){
sql="select "+dbType.concat("","subcompanyvirtualid")+" as id, subcompanyvirtualid as value, subcompanyname as title, supsubcompanyid as pId from jcl_chart_subcompanyvirtual where (canceled is null or canceled != '1') and "+dbType.ifNull("supsubcompanyid","0")+" = "+subCompany+" and companyid = '"+dimension+"' "+" and versionid = "+versionId+
" union select "+dbType.concat("d","departmentvirtualid")+"as id, departmentvirtualid as value, departmentname as title, subcompanyid as pId from jcl_chart_departmentvirtual where (canceled is null or canceled != '1') and (supdepid is null or supdepid =0) and"+dbType.ifNull("subcompanyid","0")+" = "+subCompany+" and versionid = "+versionId;
}
// 添加时间轴条件
sql+=" and versionid = "+versionId;
//// 添加时间轴条件
//sql += " and versionid = " + versionId;
}
}
returnsql;
@ -1716,7 +1789,7 @@ 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());
sql="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")+" = ? ";