ReplaceBatch.java调整

dev
wj 2 years ago
parent 0acfe9785f
commit 87ee0073c1

@ -39,9 +39,12 @@ public class ReplaceBatch extends AbstractMethod {
KeyGenerator keyGenerator = new NoKeyGenerator();
CustomerSqlMethod sqlMethod = CustomerSqlMethod.REPLACE_ONE;
List<TableFieldInfo> fieldList = tableInfo.getFieldList();
String insertSqlColumn = tableInfo.getKeyInsertSqlColumn(true, true) +
this.filterTableFieldInfo(fieldList, predicate, TableFieldInfo::getInsertSqlColumn, EMPTY);
String columnScript = LEFT_BRACKET + insertSqlColumn.substring(0, insertSqlColumn.length() - 1) + RIGHT_BRACKET;
String columnScript = SqlScriptUtils.convertTrim(tableInfo.getAllInsertSqlColumnMaybeIf(null),
LEFT_BRACKET, RIGHT_BRACKET, null, COMMA);
// String insertSqlColumn = tableInfo.getKeyInsertSqlColumn(true, true) +
// this.filterTableFieldInfo(fieldList, predicate, TableFieldInfo::getInsertSqlColumn, EMPTY);
// String columnScript = LEFT_BRACKET + insertSqlColumn.substring(0, insertSqlColumn.length() - 1) + RIGHT_BRACKET;
String insertSqlProperty = tableInfo.getKeyInsertSqlProperty(true, ENTITY_DOT, true) +
this.filterTableFieldInfo(fieldList, predicate, i -> i.getInsertSqlProperty(ENTITY_DOT), EMPTY);
insertSqlProperty = LEFT_BRACKET + insertSqlProperty.substring(0, insertSqlProperty.length() - 1) + RIGHT_BRACKET;

@ -314,7 +314,7 @@ public interface BaseMapperPlus<M, T, V> extends BaseMapper<T> {
}
}
} catch (Exception e) {
log.error("insertIgnoreBatch fail", e);
log.error("replaceBatch fail", e);
return false;
}
return true;

Loading…
Cancel
Save