diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/framework/mybatis/config/SimpleTypeHandlerConfig.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/framework/mybatis/config/SimpleTypeHandlerConfig.java deleted file mode 100644 index 7360e488ff..0000000000 --- a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/framework/mybatis/config/SimpleTypeHandlerConfig.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.iocoder.yudao.module.iot.framework.mybatis.config; - -import cn.iocoder.yudao.module.iot.framework.mybatis.handler.SimpleObjectTypeHandler; -import jakarta.annotation.PostConstruct; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.apache.ibatis.session.SqlSessionFactory; -import org.apache.ibatis.type.TypeHandlerRegistry; -import org.springframework.context.annotation.Configuration; - -/** - * 简单类型处理器配置 - * 注册自定义的类型处理器,避免 JSON 解析错误 - * - * @author 芋道源码 - */ -@Slf4j -@Configuration -public class SimpleTypeHandlerConfig { - - @Resource - private SqlSessionFactory sqlSessionFactory; - - @PostConstruct - public void registerTypeHandlers() { - TypeHandlerRegistry registry = sqlSessionFactory.getConfiguration().getTypeHandlerRegistry(); - - // 注册简单的 Object 类型处理器,避免 JSON 解析问题 - registry.register(java.lang.Object.class, new SimpleObjectTypeHandler()); - - log.info("简单类型处理器注册完成,避免 JSON 解析错误"); - } -} diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/framework/mybatis/handler/SimpleObjectTypeHandler.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/framework/mybatis/handler/SimpleObjectTypeHandler.java deleted file mode 100644 index c61bf94258..0000000000 --- a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/framework/mybatis/handler/SimpleObjectTypeHandler.java +++ /dev/null @@ -1,39 +0,0 @@ -package cn.iocoder.yudao.module.iot.framework.mybatis.handler; - -import org.apache.ibatis.type.BaseTypeHandler; -import org.apache.ibatis.type.JdbcType; - -import java.sql.CallableStatement; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; - -/** - * 简单的 Object 类型处理器 - * 直接返回字符串,避免 JSON 解析问题 - * - * @author 芋道源码 - */ -public class SimpleObjectTypeHandler extends BaseTypeHandler { - - @Override - public void setNonNullParameter(PreparedStatement ps, int i, Object parameter, JdbcType jdbcType) - throws SQLException { - ps.setString(i, parameter.toString()); - } - - @Override - public Object getNullableResult(ResultSet rs, String columnName) throws SQLException { - return rs.getString(columnName); // 直接返回字符串 - } - - @Override - public Object getNullableResult(ResultSet rs, int columnIndex) throws SQLException { - return rs.getString(columnIndex); // 直接返回字符串 - } - - @Override - public Object getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { - return cs.getString(columnIndex); // 直接返回字符串 - } -} \ No newline at end of file diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/resources/mapper/device/IotDevicePropertyMapper.xml b/yudao-module-iot/yudao-module-iot-biz/src/main/resources/mapper/device/IotDevicePropertyMapper.xml index 85149d67a1..94da3feb47 100644 --- a/yudao-module-iot/yudao-module-iot-biz/src/main/resources/mapper/device/IotDevicePropertyMapper.xml +++ b/yudao-module-iot/yudao-module-iot-biz/src/main/resources/mapper/device/IotDevicePropertyMapper.xml @@ -66,20 +66,13 @@ DESCRIBE product_property_${productId} - - - - -