sql="select id, fnumber, fname, ftype from junc_org_map where (ftype = 0 or (ftype = 1 and fobjid in("+companyIds+"))) ";
sql="select id, fnumber, fname, ftype from junc_org_map where (ftype = 0 or (ftype = 1 and fobjid in("+companyIds+")) or (ftype = 2 and fobjid in("+departmentIds+"))) ";
}else{
}else{
sql="select id, fnumber, fname, ftype from junc_org_map where ftype = 0 ";
sql="select id, fnumber, fname, ftype from junc_org_map where ftype = 0 ";