From 1fb7f04e4dad7aa5b6d21c17116613c08102cdce Mon Sep 17 00:00:00 2001 From: bootx Date: Mon, 27 Jan 2025 11:09:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20mp=E6=A1=86=E6=9E=B6=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=A4=84=E7=90=86=E5=99=A8=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatisplus/handler/IntegerListTypeHandler.java | 9 ++++++--- .../common/mybatisplus/handler/LongListTypeHandler.java | 8 +++++--- .../mybatisplus/handler/StringListTypeHandler.java | 9 ++++++--- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/bootx-platform/bootx-platform-common/common-mybatis-plus/src/main/java/cn/bootx/platform/common/mybatisplus/handler/IntegerListTypeHandler.java b/bootx-platform/bootx-platform-common/common-mybatis-plus/src/main/java/cn/bootx/platform/common/mybatisplus/handler/IntegerListTypeHandler.java index 751bd4fd..1027b8e8 100644 --- a/bootx-platform/bootx-platform-common/common-mybatis-plus/src/main/java/cn/bootx/platform/common/mybatisplus/handler/IntegerListTypeHandler.java +++ b/bootx-platform/bootx-platform-common/common-mybatis-plus/src/main/java/cn/bootx/platform/common/mybatisplus/handler/IntegerListTypeHandler.java @@ -8,6 +8,7 @@ import org.apache.ibatis.type.JdbcType; import org.apache.ibatis.type.MappedJdbcTypes; import org.apache.ibatis.type.MappedTypes; +import java.lang.reflect.Field; import java.util.List; /** @@ -19,13 +20,15 @@ import java.util.List; @MappedJdbcTypes({JdbcType.VARCHAR,JdbcType.LONGVARCHAR}) public class IntegerListTypeHandler extends AbstractJsonTypeHandler> { - /** - * 默认初始化 - */ + public IntegerListTypeHandler(Class type) { super(type); } + public IntegerListTypeHandler(Class type, Field field) { + super(type, field); + } + @Override public List parse(String json) { if (StrUtil.isNotBlank(json)){ diff --git a/bootx-platform/bootx-platform-common/common-mybatis-plus/src/main/java/cn/bootx/platform/common/mybatisplus/handler/LongListTypeHandler.java b/bootx-platform/bootx-platform-common/common-mybatis-plus/src/main/java/cn/bootx/platform/common/mybatisplus/handler/LongListTypeHandler.java index 317998f1..7c887596 100644 --- a/bootx-platform/bootx-platform-common/common-mybatis-plus/src/main/java/cn/bootx/platform/common/mybatisplus/handler/LongListTypeHandler.java +++ b/bootx-platform/bootx-platform-common/common-mybatis-plus/src/main/java/cn/bootx/platform/common/mybatisplus/handler/LongListTypeHandler.java @@ -8,6 +8,7 @@ import org.apache.ibatis.type.JdbcType; import org.apache.ibatis.type.MappedJdbcTypes; import org.apache.ibatis.type.MappedTypes; +import java.lang.reflect.Field; import java.util.List; /** @@ -19,13 +20,14 @@ import java.util.List; @MappedJdbcTypes({JdbcType.VARCHAR,JdbcType.LONGVARCHAR}) public class LongListTypeHandler extends AbstractJsonTypeHandler> { - /** - * 默认初始化 - */ + public LongListTypeHandler(Class type) { super(type); } + public LongListTypeHandler(Class type, Field field) { + super(type, field); + } @Override public List parse(String json) { if (StrUtil.isNotBlank(json)){ diff --git a/bootx-platform/bootx-platform-common/common-mybatis-plus/src/main/java/cn/bootx/platform/common/mybatisplus/handler/StringListTypeHandler.java b/bootx-platform/bootx-platform-common/common-mybatis-plus/src/main/java/cn/bootx/platform/common/mybatisplus/handler/StringListTypeHandler.java index f36ddd2a..c0b82ad2 100644 --- a/bootx-platform/bootx-platform-common/common-mybatis-plus/src/main/java/cn/bootx/platform/common/mybatisplus/handler/StringListTypeHandler.java +++ b/bootx-platform/bootx-platform-common/common-mybatis-plus/src/main/java/cn/bootx/platform/common/mybatisplus/handler/StringListTypeHandler.java @@ -9,6 +9,7 @@ import org.apache.ibatis.type.JdbcType; import org.apache.ibatis.type.MappedJdbcTypes; import org.apache.ibatis.type.MappedTypes; +import java.lang.reflect.Field; import java.util.List; /** @@ -19,12 +20,14 @@ import java.util.List; @MappedTypes(List.class) @MappedJdbcTypes({JdbcType.VARCHAR,JdbcType.LONGVARCHAR}) public class StringListTypeHandler extends AbstractJsonTypeHandler> { - private static final String COMMA = ","; - public StringListTypeHandler() { - super(List.class); + public StringListTypeHandler(Class type) { + super(type); } + public StringListTypeHandler(Class type, Field field) { + super(type, field); + } @Override public List parse(String json) { if (StrUtil.isNotBlank(json)){