直接上程式碼:
// 主關係表
List<SiemLogRelationSourceVO> abnormalLogRelationCmdbInfo = siemLogSourceDao.getAbnormalLogRelationCmdbInfo();
// 查詢(關聯關係)
List<AbnormalLogStrategyLogSourceRel> sourceRels = abnormalLogStrategyLogSourceRelDao.selectList(sourceRelWrapper);
// 組合uuid關係
List<String> itcompUuidList = sourceRels.stream().map(AbnormalLogStrategyLogSourceRel::getItcompUuid).collect(Collectors.toList());
for (SiemLogRelationSourceVO vo : abnormalLogRelationCmdbInfo
) {
// 存在則賦值
if (itcompUuidList.contains(vo.getItcompUuid())){
vo.setIsRelated(1); // 增加屬性值
}
}
return abnormalLogRelationCmdbInfo;
本作品採用《CC 協議》,轉載必須註明作者和本文連結