From e47cc79388757975a11d0091120830f98760d3cd Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Tue, 4 Jul 2023 16:11:28 +0800 Subject: [PATCH] =?UTF-8?q?ReplaceBatch.java=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/glxp/api/config/ReplaceBatch.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/glxp/api/config/ReplaceBatch.java b/src/main/java/com/glxp/api/config/ReplaceBatch.java index 61b95f6f..52babeb5 100644 --- a/src/main/java/com/glxp/api/config/ReplaceBatch.java +++ b/src/main/java/com/glxp/api/config/ReplaceBatch.java @@ -41,9 +41,12 @@ public class ReplaceBatch extends AbstractMethod { KeyGenerator keyGenerator = new NoKeyGenerator(); CustomerSqlMethod sqlMethod = CustomerSqlMethod.REPLACE_ONE; List 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;