반복 가져오기 메뉴 모음

1343 단어
@Override
public BaseResponse> listChildSort(){
//
List sysPermissionList = sysPermissionMapper.selectByParentId(0);
List childrenList = Lists.newArrayList();
for(SysPermission sysPermission : sysPermissionList){
//
childrenList.add(listChild(sysPermission));
}
if(childrenList.size() == 0 ){
return BaseResponse.createByError(" ");
}
return BaseResponse.createBySuccess(childrenList);
}
private Children listChild(SysPermission sysPermission){
//
Children children = new Children();
// Id Name
children.setId(sysPermission.getId()+"");
children.setName(sysPermission.getName());
// ID
List sysPermissionList = sysPermissionMapper.selectByParentId(sysPermission.getId().intValue());
List childrenList = Lists.newArrayList();
//
for(SysPermission sysPermissionChild : sysPermissionList){
// ,
childrenList.add(listChild(sysPermissionChild));
}
//
children.setChildren(childrenList.size() > 0 ? childrenList : null);
return children;
}

좋은 웹페이지 즐겨찾기