提交 89676e0c 编写于 作者: sq3536's avatar sq3536

lite sync

上级 f5c53118
......@@ -99,8 +99,8 @@ public class TableSyncExService extends TableSyncServiceImpl {
Timestamp lastTimestamp=DataObject.getTimestampValue(sync.getEtlTimestamp(),DataObject.getBeginDate());
QueryFilter filter=QueryFilter.createQuery();
if(entityModel.getLastModifyField()!=null)
filter.ge(entityModel.getLastModifyField().getColumnName(),lastTimestamp);
if(sourceModel.getLastModifyField()!=null)
filter.ge(sourceModel.getLastModifyField().getColumnName(),lastTimestamp);
Timestamp runTimestamp=new Timestamp(System.currentTimeMillis());
......@@ -138,7 +138,7 @@ public class TableSyncExService extends TableSyncServiceImpl {
@Override
public boolean processData(List<EntityObj> datas) {
liteDataService.saveBatch(systemId,entityName,dsName,datas);
liteDataService.saveBatch(entityModel,dsName,datas);
String updateSql = "UPDATE ibztablesync SET lastwrite=(CASE WHEN lastwrite is null then 0 else lastwrite end+#{et.count})," +
"lastendtime=CASE WHEN lastread <= lastwrite THEN #{et.lastendtime} ELSE lastendtime END," +
......
......@@ -56,6 +56,12 @@ public class LiteDataService {
return dbEntityService;
}
public boolean saveBatch(EntityModel entityModel, String dsName, List<EntityObj> list) {
splitList(list, 500).forEach(objs->{
getEntityService(StringUtils.isEmpty(dsName)?entityModel.getDsName():dsName).saveBatch(dsName,entityModel,objs);
});
return true;
}
public boolean saveBatch(String systemId, String entityName, String dsName, List<EntityObj> list) {
EntityModel entityModel = liteModelService.getEntityModel(systemId,entityName);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册