最开始写法:... like '%#{code}%' ...
,报错
改成:... like CONCAT('%',#{code},'%') ...
,报错
又改成:... like CONCAT('%','#{code}','%') ...
,报错
又又改成:... like CONCAT('%','#{code,javaType=String,jdbcType=VARCHAR}','%') ...
,报错
又又又改成:... like CONCAT('%',#{code,javaType=String,jdbcType=VARCHAR},'%') ...
,还是报错(org.postgresql.util.PSQLException: ERROR: could not determine data type of parameter $1)
然后参考https://blog.csdn.net/qq_42651904/article/details/109328018,是数据库版本问题,修改为:
... like CONCAT('%',#{code,javaType=String,jdbcType=VARCHAR}::text,'%') ...
终于好了
标签:...,PSQLException,code,postgresql,like,报错,CONCAT From: https://www.cnblogs.com/cosmicbison/p/16953373.html