From 9a36cff0d8273cc3c46bceeabd7fd2a6de3c9451 Mon Sep 17 00:00:00 2001 From: Suomm <1474983351@qq.com> Date: Tue, 2 Apr 2024 15:14:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Db=20+=20Row=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=8E=9F=E7=94=9F=20SQL=20=E6=9E=84=E5=BB=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mybatisflex/core/row/Row.java | 33 ++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/row/Row.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/row/Row.java index 82b9b334..72c3081c 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/row/Row.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/row/Row.java @@ -21,14 +21,29 @@ import com.mybatisflex.core.query.QueryCondition; import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.core.update.RawValue; import com.mybatisflex.core.update.UpdateWrapper; -import com.mybatisflex.core.util.*; +import com.mybatisflex.core.util.ArrayUtil; +import com.mybatisflex.core.util.CollectionUtil; +import com.mybatisflex.core.util.ConvertUtil; +import com.mybatisflex.core.util.LambdaGetter; +import com.mybatisflex.core.util.LambdaUtil; +import com.mybatisflex.core.util.SqlUtil; +import com.mybatisflex.core.util.StringUtil; import java.math.BigDecimal; import java.math.BigInteger; import java.sql.Time; import java.sql.Timestamp; import java.time.LocalDateTime; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; import java.util.function.BooleanSupplier; import java.util.function.Predicate; @@ -509,7 +524,12 @@ public class Row extends LinkedHashMap implements UpdateWrapper< List values = new ArrayList<>(); for (String key : keySet()) { Object value = get(key); - if (!isPk(key) && !(value instanceof RawValue)) { + if (isPk(key)) { + continue; + } + if (value instanceof RawValue) { + values.addAll(Arrays.asList(((RawValue) value).getParams())); + } else { values.add(value); } } @@ -569,7 +589,12 @@ public class Row extends LinkedHashMap implements UpdateWrapper< for (String key : keySet()) { Object value = get(key); - if (!isPk(key) && !(value instanceof RawValue)) { + if (isPk(key)) { + continue; + } + if (value instanceof RawValue) { + values.addAll(Arrays.asList(((RawValue) value).getParams())); + } else { values.add(value); } }