whereSql+=" and t.fparentid = "+id.split("_")[0]+" and ((t.ftype =2 and t.fobjid in(" +detachUtil.getDepartmentIds()+")) or (t.ftype = 3 ))";
whereSql+=" and t.fparentid = "+id.split("_")[0]+" and ((t.ftype =1 and t.fobjid in(" +detachUtil.getCompanyIds()+")) or (t.ftype =2 and t.fobjid in(" +detachUtil.getDepartmentIds()+")) or (t.ftype = 3 ))";
}
}
}else{
@ -440,14 +440,16 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
manageDeptId=id;
id=id.split("_")[0];
//sql += " and ftype = 3 ";
sql+=" and t.id != '"+id.split("_")[1]+"'";
if(manageDeptId.contains("_")){
sql+=" and t.id != '"+manageDeptId.split("_")[1]+"'";
}
}
DetachUtildetachUtil=newDetachUtil(user);
if(detachUtil.isDetach()){
if("0".equals(id)){
sql+=" and t.ftype = 1 and t.fobjid in(" +detachUtil.getCompanyIds()+")";
sql+=" and t.ftype = 1 and t.fparentid = " +id+" and t.fobjid in(" +detachUtil.getCompanyIds()+")";
}else{
if(StringUtils.isNotBlank(bmfzr)){
bmfzr=bmfzr.split(",")[0];
@ -455,7 +457,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
sql+=" and t.ftype = 3 and fobjid = '"+bmfzr+"' ";
sql+=" and t.fparentid = "+id+" and ((t.ftype =2 and t.fobjid in(" +detachUtil.getDepartmentIds()+")) or (t.ftype = 3 ))";
sql+=" and t.fparentid = "+id+" and ((t.ftype =1 and t.fobjid in(" +detachUtil.getCompanyIds()+")) or (t.ftype =2 and t.fobjid in(" +detachUtil.getDepartmentIds()+")) or (t.ftype = 3 ))";