优化[删除标签接口]性能
This commit is contained in:
+1
-4
@@ -156,11 +156,8 @@ public class ITreeLabelServiceImpl extends ServiceImpl<TreeLabelDao, TreeLabelEn
|
||||
public boolean deleteById(String id) {
|
||||
List<String> nodeAndChildrenIds = findNodeAndChildrenIds(getTreeLabelRoot(), id).stream().distinct().collect(Collectors.toList());
|
||||
LambdaQueryWrapper<ReportLabelEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
nodeAndChildrenIds.forEach(labelLd -> {
|
||||
wrapper.eq(ReportLabelEntity::getLabelId, labelLd);
|
||||
wrapper.in(ReportLabelEntity::getLabelId, nodeAndChildrenIds);
|
||||
reportLabelDao.delete(wrapper);
|
||||
});
|
||||
|
||||
int i = treeLabelDao.deleteBatchIds(nodeAndChildrenIds);
|
||||
return i != 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user