List<JSONObject>empInfo=orgService.select(String.format("select t1.ORGCODE, t2.DEPTCODE, t1.ORGLEVEL,t2.DEPTLEVEL from ibzemp t left join ibzorg t1 on t.orgid =t1.orgid left join ibzdept t2 on t.MDEPTID=t2.DEPTID where t.LOGINNAME='%s' ",loginName));
if(empInfo.size()==0)
returnnull;
orgLevel=empInfo.get(0).getString("ORGLEVEL");
deptLevel=empInfo.get(0).getString("DEPTLEVEL");
//通过levelCode查询上下级组织信息
List<JSONObject>pOrgLists=orgService.select(String.format("select orgcode from ibzorg t where INSTR('%s', t.orglevel )=1 ",orgLevel));
List<JSONObject>sOrgLists=orgService.select(String.format("select orgcode from ibzorg t where INSTR(t.orglevel ,'%s' )=1 ",orgLevel));
List<JSONObject>pOrgDeptLists=orgService.select(String.format("select deptcode from ibzdept t where INSTR('%s',t.deptlevel)=1 ",deptLevel));
List<JSONObject>sOrgDeptLists=orgService.select(String.format("select deptcode from ibzdept t where INSTR(t.deptlevel,'%s')=1 ",deptLevel));