|
@@ -2,6 +2,7 @@ package com.onemap.analyse.service.impl;
|
|
|
|
|
|
import com.onemap.analyse.mapper.vector.CreateUtilsDBMapper;
|
|
|
import com.onemap.analyse.service.CreateUtilsDBService;
|
|
|
+import com.onemap.common.core.utils.StringUtils;
|
|
|
import org.bouncycastle.util.Strings;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -20,7 +21,8 @@ public class CreateUtilsDBServiceImpl implements CreateUtilsDBService {
|
|
|
long timestamp = System.currentTimeMillis();
|
|
|
String[] tableNames = Strings.split(tableName, '_');
|
|
|
|
|
|
- String newTableName = TEMPORARY + "_" + timestamp + "_buffer_" + tableNames[tableNames.length - 1];
|
|
|
+ // String newTableName = TEMPORARY + "_" + timestamp + "_buffer_" + tableNames[tableNames.length - 1];
|
|
|
+ String newTableName = StringUtils.getTemporaryTableName();
|
|
|
createUtilsDBMapper.bufferTable(tableName, radius, newTableName);
|
|
|
return newTableName;
|
|
|
}
|
|
@@ -30,8 +32,9 @@ public class CreateUtilsDBServiceImpl implements CreateUtilsDBService {
|
|
|
long timestamp = System.currentTimeMillis();
|
|
|
String[] tableNames = Strings.split(tableName, '_');
|
|
|
|
|
|
- String newTableName = TEMPORARY + "_" + timestamp + "_buffer_" + tableNames[tableNames.length - 1];
|
|
|
+ // String newTableName = TEMPORARY + "_" + timestamp + "_buffer_" + tableNames[tableNames.length - 1];
|
|
|
|
|
|
+ String newTableName = StringUtils.getTemporaryTableName();
|
|
|
createUtilsDBMapper.bufferColumnTable(tableName, column, newTableName);
|
|
|
return newTableName;
|
|
|
}
|
|
@@ -51,7 +54,8 @@ public class CreateUtilsDBServiceImpl implements CreateUtilsDBService {
|
|
|
long timestamp = System.currentTimeMillis();
|
|
|
String[] tableNames = Strings.split(tableName, '_');
|
|
|
|
|
|
- String newTableName = TEMPORARY + "_" + timestamp + "_diff_wkt_" + tableNames[tableNames.length - 1];
|
|
|
+ // String newTableName = TEMPORARY + "_" + timestamp + "_diff_wkt_" + tableNames[tableNames.length - 1];
|
|
|
+ String newTableName = StringUtils.getTemporaryTableName();
|
|
|
createUtilsDBMapper.differenceTableWkt(tableName, tableIds, ewkt, newTableName);
|
|
|
return newTableName;
|
|
|
}
|
|
@@ -62,7 +66,10 @@ public class CreateUtilsDBServiceImpl implements CreateUtilsDBService {
|
|
|
String[] tableNamesA = Strings.split(tableNameA, '_');
|
|
|
String[] tableNamesB = Strings.split(tableNameB, '_');
|
|
|
|
|
|
- String newTableName = TEMPORARY + "_" + timestamp + "_" + tableNamesA[tableNamesA.length - 1] + "_diff_" + tableNamesB[tableNamesB.length - 1];
|
|
|
+ // String newTableName = TEMPORARY + "_" + timestamp + "_" + tableNamesA[tableNamesA.length - 1] + "_diff_" + tableNamesB[tableNamesB.length - 1];
|
|
|
+ String newTableName = StringUtils.getTemporaryTableName();
|
|
|
+
|
|
|
+
|
|
|
|
|
|
String temporaryTable = "temporaryTable_" + timestamp;
|
|
|
createUtilsDBMapper.differenceTables(tableNameA, tableIdsA, tableNameB, newTableName, temporaryTable);
|
|
@@ -79,7 +86,9 @@ public class CreateUtilsDBServiceImpl implements CreateUtilsDBService {
|
|
|
long timestamp = System.currentTimeMillis();
|
|
|
String[] tableNames = Strings.split(tableName, '_');
|
|
|
|
|
|
- String newTableName = TEMPORARY + "_" + timestamp + "_inter_wkt_" + tableNames[tableNames.length - 1];
|
|
|
+ // String newTableName = TEMPORARY + "_" + timestamp + "_inter_wkt_" + tableNames[tableNames.length - 1];
|
|
|
+ String newTableName = StringUtils.getTemporaryTableName();
|
|
|
+
|
|
|
createUtilsDBMapper.intersectionTableWkt(tableName, tableIds, ewkt, newTableName);
|
|
|
return newTableName;
|
|
|
}
|
|
@@ -90,7 +99,8 @@ public class CreateUtilsDBServiceImpl implements CreateUtilsDBService {
|
|
|
String[] tableNamesA = Strings.split(tableNameA, '_');
|
|
|
String[] tableNamesB = Strings.split(tableNameB, '_');
|
|
|
|
|
|
- String newTableName = TEMPORARY + "_" + timestamp + "_" + tableNamesA[tableNamesA.length - 1] + "_inter_table_" + tableNamesB[tableNamesB.length - 1];
|
|
|
+ // String newTableName = TEMPORARY + "_" + timestamp + "_" + tableNamesA[tableNamesA.length - 1] + "_inter_table_" + tableNamesB[tableNamesB.length - 1];
|
|
|
+ String newTableName = StringUtils.getTemporaryTableName();
|
|
|
createUtilsDBMapper.intersectionTables(tableNameA, tableIdsA, tableNameB, newTableName);
|
|
|
return newTableName;
|
|
|
}
|