@ -66,8 +66,8 @@ public class ImportExcelKit {
finalSql + = "CREATE INDEX ON \"public\".\"" + tableName + "\" (\"person_id\");" ;
Db . update ( finalSql ) ;
//写入模板与表结构的关系t_ importexcel _mapping
String sql = "delete from t_ importexcel _mapping where table_name=?";
//写入模板与表结构的关系t_ collect _mapping
String sql = "delete from t_ collect _mapping where table_name=?";
Db . update ( sql , tableName ) ;
int sheet_index = input . getInt ( "sheet_index" ) ;
@ -87,10 +87,10 @@ public class ImportExcelKit {
record . set ( "options" , list . get ( i ) . getStr ( "options" ) ) ;
writeList . add ( record ) ;
}
Db . batchSave ( "t_ importexcel _mapping", writeList , 100 ) ;
Db . batchSave ( "t_ collect _mapping", writeList , 100 ) ;
//记录模板文件的头文件位置,开始行,结束行,开始列,结束列
sql = "delete from t_ importexcel _config where upload_excel_filename=? and table_name=?";
sql = "delete from t_ collect _config where upload_excel_filename=? and table_name=?";
Db . update ( sql , upload_excel_filename , tableName ) ;
int start_row = input . getInt ( "start_row" ) ;
@ -111,7 +111,7 @@ public class ImportExcelKit {
record . set ( "sheet_name" , sheet_name ) ;
record . set ( "data_start_row" , data_start_row ) ;
record . set ( "column_num" , column_num ) ;
Db . save ( "t_ importexcel _config", "id" , record ) ;
Db . save ( "t_ collect _config", "id" , record ) ;
Kv kv = Kv . create ( ) ;
kv . set ( "success" , true ) ;
@ -147,7 +147,7 @@ public class ImportExcelKit {
* @return
* /
public static Record getSheetConfig ( String upload_excel_filename , int sheet_index ) {
String sql = "select * from t_ importexcel _config where upload_excel_filename=? and sheet_index=?";
String sql = "select * from t_ collect _config where upload_excel_filename=? and sheet_index=?";
return Db . findFirst ( sql , upload_excel_filename , sheet_index ) ;
}
@ -158,7 +158,7 @@ public class ImportExcelKit {
* @return
* /
public static int getSheetCount ( String upload_excel_filename ) {
String sql = "select * from t_ importexcel _config where upload_excel_filename=?";
String sql = "select * from t_ collect _config where upload_excel_filename=?";
List < Record > list = Db . find ( sql , upload_excel_filename ) ;
return list . size ( ) ;
}
@ -171,7 +171,7 @@ public class ImportExcelKit {
* @return
* /
public static List < Record > getSheetMapping ( String upload_excel_filename , int sheet_index ) {
String sql = "select * from t_ importexcel _mapping where upload_excel_filename=? and sheet_index=?";
String sql = "select * from t_ collect _mapping where upload_excel_filename=? and sheet_index=?";
return Db . find ( sql , upload_excel_filename , sheet_index ) ;
}
@ -187,7 +187,7 @@ public class ImportExcelKit {
//读取sheet页
XSSFSheet sheet = wb . getSheetAt ( sheetIdx ) ;
//通过表名获取到它的读取起始行,终止列
String sql = "select * from t_ importexcel _config where upload_excel_filename=? and sheet_index=?";
String sql = "select * from t_ collect _config where upload_excel_filename=? and sheet_index=?";
Record record = Db . findFirst ( sql , upload_excel_filename , sheetIdx ) ;
String table_name = record . getStr ( "table_name" ) ;
@ -199,7 +199,7 @@ public class ImportExcelKit {
int column_num = record . getInt ( "column_num" ) ;
//获取字段与EXCEL列的映射信息
sql = "select * from t_ importexcel _mapping where upload_excel_filename=? and sheet_index=?";
sql = "select * from t_ collect _mapping where upload_excel_filename=? and sheet_index=?";
List < Record > list = Db . find ( sql , upload_excel_filename , sheetIdx ) ;
Map < Integer , Record > _map = new HashMap < > ( ) ;
for ( Record r : list ) {