Explorar o código

新增 Wrapper 条件辅助类

hubin %!s(int64=7) %!d(string=hai) anos
pai
achega
a5c4b70c0d

+ 8 - 0
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/conditions/Condition.java

@@ -40,6 +40,10 @@ public class Condition {
         return new QueryWrapper<>();
     }
 
+    public static <T> QueryWrapper<T> create(T entity) {
+        return new QueryWrapper<>(entity);
+    }
+
     /**
      * <p>
      * 获取 LambdaQueryWrapper 实例
@@ -51,4 +55,8 @@ public class Condition {
     public static <T> LambdaQueryWrapper<T> lambda() {
         return new LambdaQueryWrapper<>();
     }
+
+    public static <T> LambdaQueryWrapper<T> lambda(T entity) {
+        return new LambdaQueryWrapper<>(entity);
+    }
 }