From 1f95282869b0e170063bc206cadd40c643fd9dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=A2=A6=E8=BF=9C?= <1063331231@qq.com> Date: Mon, 4 Aug 2025 20:49:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8A=A5=E9=94=99=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/handler/DeviceTypeHandler.java | 40 ---------------------- 1 file changed, 40 deletions(-) delete mode 100644 src/main/java/com/iflytop/colortitration/common/handler/DeviceTypeHandler.java diff --git a/src/main/java/com/iflytop/colortitration/common/handler/DeviceTypeHandler.java b/src/main/java/com/iflytop/colortitration/common/handler/DeviceTypeHandler.java deleted file mode 100644 index bc61ca2..0000000 --- a/src/main/java/com/iflytop/colortitration/common/handler/DeviceTypeHandler.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.iflytop.colortitration.common.handler; - -import com.iflytop.colortitration.common.enums.Device; -import org.apache.ibatis.type.BaseTypeHandler; -import org.apache.ibatis.type.JdbcType; -import org.apache.ibatis.type.MappedJdbcTypes; -import org.apache.ibatis.type.MappedTypes; - -import java.sql.CallableStatement; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; - -@MappedJdbcTypes(JdbcType.VARCHAR) -@MappedTypes(Device.class) -public class DeviceTypeHandler extends BaseTypeHandler { - - @Override - public void setNonNullParameter(PreparedStatement ps, int i, Device parameter, JdbcType jdbcType) throws SQLException { - ps.setString(i, parameter.name()); - } - - @Override - public Device getNullableResult(ResultSet rs, String columnName) throws SQLException { - String name = rs.getString(columnName); - return name == null ? null : Device.valueOf(name); - } - - @Override - public Device getNullableResult(ResultSet rs, int columnIndex) throws SQLException { - String name = rs.getString(columnIndex); - return name == null ? null : Device.valueOf(name); - } - - @Override - public Device getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { - String name = cs.getString(columnIndex); - return name == null ? null : Device.valueOf(name); - } -} \ No newline at end of file