update
This commit is contained in:
1
nms_sync/.gitignore
vendored
Normal file
1
nms_sync/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/bin/
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -108,6 +108,9 @@ public class SyncSlaveToMasterThread implements Runnable{
|
||||
for(Record insertData:insertDatas){
|
||||
Record seqData = Db.use("masterDataSource").findFirst("select nextval('seq_"+record.getStr("table_name")+"') seqId from dual");
|
||||
insertData.set(record.getStr("id_name"), seqData.getLong("seqId"));
|
||||
if(record.getStr("table_name").equals("event_record_library")) {
|
||||
insertData.set("sync_status",1);
|
||||
}
|
||||
}
|
||||
Db.use("masterDataSource").batchSave(record.getStr("table_name"), insertDatas, record.getInt("batch_size"));
|
||||
// 同步完成后 取出最后一条数据的id 更新到table_sync_info表中 用作下次使用
|
||||
|
||||
@@ -118,6 +118,9 @@ public class SyncThread implements Runnable {
|
||||
for(Record insertData:insertDatas){
|
||||
Record seqData = Db.use(url).findFirst("select nextval('seq_"+record.getStr("table_name")+"') seqId from dual");
|
||||
insertData.set(record.getStr("id_name"), seqData.getLong("seqId"));
|
||||
if(record.getStr("table_name").equals("event_record_library")) {
|
||||
insertData.set("sync_status",1);
|
||||
}
|
||||
}
|
||||
Db.use(url).batchSave(record.getStr("table_name"), insertDatas, record.getInt("batch_size"));
|
||||
// 同步完成后 取出最后一条数据的id 更新到table_sync_info表中 用作下次使用
|
||||
|
||||
Reference in New Issue
Block a user