|
@@ -110,4 +110,13 @@ public interface BaseService<T extends BaseIdPo> extends IService<T> {
|
|
.stream().map(column).filter(Objects::nonNull).distinct().collect(Collectors.toList());
|
|
.stream().map(column).filter(Objects::nonNull).distinct().collect(Collectors.toList());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 编辑关联表
|
|
|
|
+ */
|
|
|
|
+ default void editLinked(List<T> list, SFunction<T, Long> getMasterIdFun, Long masterId) {
|
|
|
|
+ List<Long> idList = list.stream().map(BaseIdPo::getId).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
|
+ remove(q -> q.eq(getMasterIdFun, masterId).notIn(ObjectUtil.isNotEmpty(idList), BaseIdPo::getId, idList));
|
|
|
|
+ saveOrUpdateBatch(list);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|