|
@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
|
|
import lombok.AccessLevel;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.example.join.model.IFormat;
|
|
|
-import org.example.join.model.ISelect;
|
|
|
+import org.example.join.model.IQueryColumn;
|
|
|
import org.example.join.model.ITable;
|
|
|
import org.example.join.model.QueryColumn;
|
|
|
import org.example.join.model.QueryCondition;
|
|
@@ -23,7 +23,7 @@ import java.util.stream.Collectors;
|
|
|
@RequiredArgsConstructor(access = AccessLevel.PROTECTED)
|
|
|
public class Sql implements IFormat {
|
|
|
|
|
|
- protected final List<ISelect> queryFieldsList = new ArrayList<>();
|
|
|
+ protected final List<IQueryColumn> queryFieldsList = new ArrayList<>();
|
|
|
protected final List<ITable> queryTableList = new ArrayList<>();
|
|
|
protected final List<QueryCondition> queryConditionList = new ArrayList<>();
|
|
|
protected final List<QueryColumn> groupByList = new ArrayList<>();
|
|
@@ -87,13 +87,13 @@ public class Sql implements IFormat {
|
|
|
if (iTable instanceof Table table) {
|
|
|
String tableDelFlag = SqlContext.getTableDelFlag(table);
|
|
|
if (ObjectUtil.isNotEmpty(tableDelFlag)) {
|
|
|
- QueryColumn queryColumn = new QueryColumn(table, tableDelFlag);
|
|
|
+ QueryColumn queryColumn = new QueryColumn(table.getAlias(), tableDelFlag);
|
|
|
sql.queryConditionList.add(0, new QueryCondition(queryColumn, SqlConstant.EQ, sql.logic ? 1 : 0));
|
|
|
}
|
|
|
} else if (iTable instanceof TableJoin tableJoin && tableJoin.getTable() instanceof Table table) {
|
|
|
String tableDelFlag = SqlContext.getTableDelFlag(table);
|
|
|
if (ObjectUtil.isNotEmpty(tableDelFlag)) {
|
|
|
- QueryColumn queryColumn = new QueryColumn(table, tableDelFlag);
|
|
|
+ QueryColumn queryColumn = new QueryColumn(table.getAlias(), tableDelFlag);
|
|
|
tableJoin.getQueryConditionList().add(new QueryCondition(queryColumn, SqlConstant.EQ, sql.logic ? 1 : 0));
|
|
|
}
|
|
|
}
|