1. 编写类型解析器
方案1:实现TypeHandler重写方法
package com.aliyun.kuxuandemo.typeHandler;
import org.apache.ibatis.type.*;
import java.sql.*;
import java.util.Arrays;
import java.util.List;
@MappedJdbcTypes(JdbcType.VARCHAR)
@MappedTypes(List.class)
public class ListTypeHandler implements TypeHandler<List<String>> {
@Override
public void setParameter(PreparedStatement ps, int i, List<String> parameter, JdbcType jdbcType) throws SQLException {
StringBuffer sb = new StringBuffer();
for (String pa : parameter) {
sb.append(pa).append(",");
}
ps.setString(i, sb.toString().substring(0, sb.toString().length() - 1));
}
@Override
public List<String> getResu