@ -1760,14 +1760,14 @@ public class ChartServiceImpl extends Service implements ChartService {
" 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;
}
}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","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;
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+"' "+
" 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("","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;