24282 1 年之前
父节点
当前提交
cf227eb12a
共有 2 个文件被更改,包括 6 次插入7 次删除
  1. 5 5
      my-test/src/main/java/org/example/join/sql/From.java
  2. 1 2
      my-test/src/test/java/MySpringBootTest.java

+ 5 - 5
my-test/src/main/java/org/example/join/sql/From.java

@@ -1,6 +1,6 @@
 package org.example.join.sql;
 package org.example.join.sql;
 
 
-import org.example.join.model.Table;
+import org.example.join.model.ITable;
 import org.example.join.model.TableJoin;
 import org.example.join.model.TableJoin;
 
 
 public class From extends SqlWrapper {
 public class From extends SqlWrapper {
@@ -12,19 +12,19 @@ public class From extends SqlWrapper {
         this.sql = sql;
         this.sql = sql;
     }
     }
 
 
-    public Join innerJoin(Table table) {
+    public Join innerJoin(ITable table) {
         return join(SqlConstant.INNER_JOIN, table);
         return join(SqlConstant.INNER_JOIN, table);
     }
     }
 
 
-    public Join leftJoin(Table table) {
+    public Join leftJoin(ITable table) {
         return join(SqlConstant.LEFT_JOIN, table);
         return join(SqlConstant.LEFT_JOIN, table);
     }
     }
 
 
-    public Join rightJoin(Table table) {
+    public Join rightJoin(ITable table) {
         return join(SqlConstant.RIGHT_JOIN, table);
         return join(SqlConstant.RIGHT_JOIN, table);
     }
     }
 
 
-    private Join join(String joinType, Table table) {
+    private Join join(String joinType, ITable table) {
         TableJoin tableJoin = new TableJoin(joinType, table);
         TableJoin tableJoin = new TableJoin(joinType, table);
         sql.queryTableList.add(tableJoin);
         sql.queryTableList.add(tableJoin);
         return new Join(this, tableJoin.getQueryConditionList());
         return new Join(this, tableJoin.getQueryConditionList());

+ 1 - 2
my-test/src/test/java/MySpringBootTest.java

@@ -39,8 +39,7 @@ public class MySpringBootTest {
                 //.logic()
                 //.logic()
                 .select(
                 .select(
                         dept_id,
                         dept_id,
-                        tenant_id,
-                        childTable.field(status),
+                        childTable.field(tenant_id),
                         childTable.field("status"),
                         childTable.field("status"),
                         Sql.create().select(dept_id).from(sys_dept).limit(1).as("ccc")
                         Sql.create().select(dept_id).from(sys_dept).limit(1).as("ccc")
                 )
                 )