//需求:对结果集(已经从数据库中得到结果集)进行过滤,List<IR> IR为实体
//条件:(1)不能为空(2)最终得到的结果集不能为空
//实质就是把过滤好的结果集放到另一个结果集中。
List<IR> list = irDao.findNoPageIRList(params, searchTemplate);
List<IR> resultNoPageList = new ArrayList<IR>();
//export excel resutl on the basis of fiber
String cablecore="";
String fiberdp = "";
String mfibercode = "";
IR ir0 = list.get(0);
resultNoPageList.add(ir0);
out://标记
for(int i=1;i<list.size();i++){//cablecore fiberdp mfibercode unique
IR ir = list.get(i);
cablecore = ir.getCableCode();
fiberdp = ir.getFiberDp();
mfibercode = ir.getFiberCore();
//the first: fiber not null
if(cablecore==null&&fiberdp==null&&mfibercode==null){
continue;
}
//the second: is not repeat
for(int j=0;j<resultNoPageList.size();j++){
IR resultIR = resultNoPageList.get(j);
if((cablecore.equals(resultIR.getCableCode())
&&fiberdp.equals(resultIR.getFiberDp())
&&mfibercode.equals(resultIR.getFiberCore()))){
continue out;// to the next loop(outer)
}
}
//the last: add to resultList
resultNoPageList.add(ir);
}