1.for循环list<实体>
List<DeploymentWellDeploymentVo> resultList = DeploymentMapper.selectList(wellDeploymentVo);
for (DeploymentWellDeploymentVo deployment : resultList) {
List<FileVo> fileVos= fjghwjxxMapper.getFileList(deployment.getDbid());
if(fileVos.size()>0){
for (FileVo fileVo : fileVos) {
fileVo.setDownloadUrl(downLoadUrl+fileVo.getFileId());
fileVo.setPreviewUrl(previewUrl+fileVo.getFileId());
}
}
deployment.setFileList(fileVos);
}
2。for循环List<Map<String, Object>>
List<Map<String, Object>> resultList = oilWellComAcceptanceMapper.queryList(oilWellCompletionAcceptance);
for (Map<String, Object> map : resultList) {
if(StringUtils.isNotEmpty(map.get("dbid").toString())) {
List<FileVo> fileVos = fjghwjxxService.getFileListBySSBM(map.get("dbid").toString(), SSBM);
map.put("fileList", fileVos);
}
}
代码段1展示了遍历List<DeploymentWellDeploymentVo>,获取每个实体的FileVo列表,设置下载和预览Url。代码段2中,遍历List<Map<String,Object>>,根据dbid获取FileVo列表并添加到Map中。
840

被折叠的 条评论
为什么被折叠?



