提交 91929a76 authored 作者: wangjiahao's avatar wangjiahao

Merge remote-tracking branch 'origin/main' into main

......@@ -27,12 +27,12 @@
select id , name , `desc` ,`type` , configuration ,create_time ,update_time
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'link') cids) t,datasource
<where>
FIND_IN_SET(datasource.id,cids))
FIND_IN_SET(datasource.id,cids)
<if test="id != null">
id = #{id,jdbcType=VARCHAR}
</if>
<if test="name != null">
`name` = concat('%',#{name,jdbcType=VARCHAR},'%')
`name` like concat('%',#{name,jdbcType=VARCHAR},'%')
</if>
<if test="desc != null">
`desc` = #{desc,jdbcType=VARCHAR}
......
......@@ -202,6 +202,9 @@ public class JdbcProvider extends DatasourceProvider {
tableFiled.setFieldSize(Integer.valueOf(resultSet.getString("COLUMN_SIZE")));
String dbType = resultSet.getString("TYPE_NAME");
tableFiled.setFieldType(dbType);
if(StringUtils.isNotEmpty(dbType) && dbType.equalsIgnoreCase("date") && tableFiled.getFieldSize() < 50 ){
tableFiled.setFieldSize(50);
}
list.add(tableFiled);
}
}
......
......@@ -41,7 +41,7 @@ public class ProviderFactory implements ApplicationContextAware {
case doris:
return context.getBean("dorisQuery", QueryProvider.class);
case sqlServer:
return context.getBean("mysqlQuery", QueryProvider.class);
return context.getBean("sqlserverQuery", QueryProvider.class);
default:
return context.getBean("mysqlQuery", QueryProvider.class);
}
......
......@@ -12,6 +12,7 @@ import io.dataease.commons.utils.LogUtil;
import io.dataease.datasource.constants.DatasourceTypes;
import io.dataease.datasource.dto.DorisConfigration;
import io.dataease.datasource.dto.MysqlConfigration;
import io.dataease.datasource.dto.SqlServerConfigration;
import io.dataease.datasource.dto.TableFiled;
import io.dataease.datasource.provider.DatasourceProvider;
import io.dataease.datasource.provider.JdbcProvider;
......@@ -188,7 +189,6 @@ public class ExtractDataService {
return o1.getColumnIndex().compareTo(o2.getColumnIndex());
});
String dorisTablColumnSql = createDorisTablColumnSql(datasetTableFields);
System.out.println(dorisTablColumnSql);
switch (updateType) {
// 全量更新
case all_scope:
......@@ -443,6 +443,17 @@ public class ExtractDataService {
}
inputStep = inputStep(transMeta, selectSQL);
break;
case sqlServer:
SqlServerConfigration sqlServerConfigration = new Gson().fromJson(datasource.getConfiguration(), SqlServerConfigration.class);
dataMeta = new DatabaseMeta("db", "MSSQLNATIVE", "Native", sqlServerConfigration.getHost(), sqlServerConfigration.getDataBase(), sqlServerConfigration.getPort().toString(), sqlServerConfigration.getUsername(), sqlServerConfigration.getPassword());
transMeta.addDatabase(dataMeta);
if (extractType.equalsIgnoreCase("all_scope")) {
String tableName = new Gson().fromJson(datasetTable.getInfo(), DataTableInfoDTO.class).getTable();
QueryProvider qp = ProviderFactory.getQueryProvider(datasource.getType());
selectSQL = qp.createQuerySQL(tableName, datasetTableFields);
}
inputStep = inputStep(transMeta, selectSQL);
break;
case excel:
String filePath = new Gson().fromJson(datasetTable.getInfo(), DataTableInfoDTO.class).getData();
inputStep = excelInputStep(filePath, datasetTableFields);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论