rs.executeQuery("select bmfzr from hrmdepartmentdefined where deptid =? ",Integer.parseInt(id)-100000000);
if(rs.next()){
bmfzr=rs.getString("bmfzr");
}
}
}
DetachUtildetachUtil=newDetachUtil(user);
if(detachUtil.isDETACH()){
if("0".equals(ids)){
whereSql+=" and t.ftype = 1 and t.fobjid in("+detachUtil.getCompanyIds()+")";
if(detachUtil.isDETACH()){
if("0".equals(id)){
whereSql+=" and t.ftype = 1 and t.fobjid in("+detachUtil.getCompanyIds()+")";
}else{
if(StringUtils.isNotBlank(bmfzr)){
bmfzr=bmfzr.split(",")[0];
whereSql+=" and ((t.fparentid = "+id.split("_")[0]+" and t.ftype =2 and t.fobjid in("+detachUtil.getDepartmentIds()+")) or (t.ftype = 3 and fobjid = '"+bmfzr+"'))";
//whereSql += " and ((t.fparentid = " + id.split("_")[0] + " and t.ftype = 2 ) or (t.ftype = 3 and fobjid = '" + bmfzr + "'))";
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];
}
}
}else{
if(StringUtils.isNotBlank(bmfzr)){
bmfzr=bmfzr.split(",")[0];
whereSql+=" and ((t.fparentid = "+ids.split("_")[0]+" and t.ftype =2 and t.fobjid in("+detachUtil.getDepartmentIds()+")) or (t.ftype = 3 and fobjid = '"+bmfzr+"'))";
whereSql+=" and ((t.fparentid = "+id.split("_")[0]+" and t.ftype =2 ) or (t.ftype = 3 and fobjid = '" +bmfzr+"'))";