24282 1 vuosi sitten
vanhempi
commit
cf227eb12a

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

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

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

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