From ad6c60dc9fdc56face2130973037a463881bf7ab Mon Sep 17 00:00:00 2001 From: "youhong.ai" Date: Fri, 12 May 2023 21:14:04 +0800 Subject: [PATCH] =?UTF-8?q?mapper=E6=8B=BC=E6=8E=A5=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/aiyh/utils/recordset/MapperBuilderSql.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/aiyh/utils/recordset/MapperBuilderSql.java b/src/main/java/aiyh/utils/recordset/MapperBuilderSql.java index 13fff23..505711c 100644 --- a/src/main/java/aiyh/utils/recordset/MapperBuilderSql.java +++ b/src/main/java/aiyh/utils/recordset/MapperBuilderSql.java @@ -99,12 +99,13 @@ public class MapperBuilderSql { sb.append(" where "); } for (Map.Entry entry : param.entrySet()) { - sb.append(entry.getKey()).append(" and ").append("#{"); + sb.append(entry.getKey()).append(" = #{"); if (StrUtil.isNotBlank(wherePrefix)) { sb.append(wherePrefix).append("."); } - sb.append(entry.getKey()).append("}"); + sb.append(entry.getKey()).append("}").append(" and "); } + sb.deleteCharAt(sb.length() - 5); return sb.toString(); } }