参考oracle 使用listagg函数报 ORA-01489: result of string concatenation is too long错误处理_whandgdh的博客-优快云博客
把原先的LISTAGG(id, ',') WITHIN GROUP(order by id) id修改成:
(xmlagg(xmlparse(content id || ',' wellformed) ORDER BY id).getclobval()).ldtext id
从而jdbcType就变成了clob类型
查出结果resultType为HashMap时,value可这么转换:
value = value == null ? null : ((java.sql.Clob)value).getSubString(1L, (int)((java.sql.Clob)value).length());
如果是DTO,则用这个类型转换器:org.apache.ibatis.type.ClobTypeHandler