|
@@ -72,7 +72,7 @@ public class KingBase2GBaseService {
|
|
|
|
|
|
List<Map<String, Object>> data = thisJdbc.query("select * from " + tableName, new UpperMapRowMapper());
|
|
|
if (data.isEmpty()) {
|
|
|
- log.warn("{}表中数据为空,不尽兴转换,请确认实际为空真实性", tableName);
|
|
|
+ log.warn("{}表中数据为空,不进行转换,请确认实际为空真实性", tableName);
|
|
|
return;
|
|
|
}
|
|
|
Set<String> keys = data.get(0).keySet();
|
|
@@ -81,12 +81,16 @@ public class KingBase2GBaseService {
|
|
|
String insertSqlValue = ":" + CollectionUtil.join(sortedKeys, ", :");
|
|
|
String sql = "insert into " + tableName + "(" + insertSqlKey + ") values(" + insertSqlValue + ")";
|
|
|
log.debug("执行的SQL为:{}", sql);
|
|
|
- MapSqlParameterSource sqlParam = new MapSqlParameterSource();
|
|
|
- otherJdbc.update("delete from " + tableName, sqlParam);
|
|
|
+ MapSqlParameterSource sqlParam;
|
|
|
+ otherJdbc.update("delete from " + tableName);
|
|
|
+ int x = 0;
|
|
|
for (Map<String, Object> map : data) {
|
|
|
- otherJdbc.update(sql, map);
|
|
|
- ;
|
|
|
+ otherJdbc.update(sql,new MapSqlParameterSource(map));
|
|
|
+ if (x++%10==0){
|
|
|
+ otherJdbc.update("commit");
|
|
|
+ }
|
|
|
}
|
|
|
+ otherJdbc.update("commit");
|
|
|
}
|
|
|
|
|
|
|