List<Canal> canals = canalService.listByCondition(condition);
List<SeniorCanal> seniorCanals = new ArrayList<SeniorCanal>();
for (Canal canal : canals) {
SeniorCanal seniorCanal = new SeniorCanal();
seniorCanal.setId(canal.getId());
seniorCanal.setName(canal.getName());
seniorCanal.setStatus(canal.getStatus());
seniorCanal.setDesc(canal.getDesc());
seniorCanal.setCanalParameter(canal.getCanalParameter());
seniorCanal.setGmtCreate(canal.getGmtCreate());
seniorCanal.setGmtModified(canal.getGmtModified());
List<Pipeline> pipelines = pipelineService.listByDestinationWithoutOther(canal.getName());
seniorCanal.setPipelines(pipelines);
seniorCanal.setUsed(!pipelines.isEmpty());
seniorCanals.add(seniorCanal);
}
context.put("seniorCanals", seniorCanals);
context.put("paginator", paginator);
context.put("searchKey", searchKey);