|
@@ -393,4 +393,17 @@ public interface IService<T> {
|
|
default LambdaUpdateChainWrapper<T> lambdaUpdate() {
|
|
default LambdaUpdateChainWrapper<T> lambdaUpdate() {
|
|
return new LambdaUpdateChainWrapper<>(getBaseMapper());
|
|
return new LambdaUpdateChainWrapper<>(getBaseMapper());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * <p>
|
|
|
|
+ * 根据updateWrapper尝试更新,否继续执行saveOrUpdate(T)方法
|
|
|
|
+ * 此次修改主要是减少了此项业务代码的代码量(存在性验证之后的saveOrUpdate操作)
|
|
|
|
+ * </p>
|
|
|
|
+ *
|
|
|
|
+ * @param entity 实体对象
|
|
|
|
+ */
|
|
|
|
+ default boolean saveOrUpdate(T entity, Wrapper<T> updateWrapper) {
|
|
|
|
+ return update(entity, updateWrapper) || saveOrUpdate(entity);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|