mybatis 使用中的错误记录

mybatis 使用中的错误记录

一、在mapper中使用#占位符传参时,在两侧加引号,导致解析错误

错误提示:

Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #3 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2).

错误定位:

and t1.content_title like concat('%','#{articleTitle}','%')

修改问题:

and t1.content_title like concat('%',#{articleTitle},'%')
原创文章 161 获赞 19 访问量 6万+

猜你喜欢

转载自blog.csdn.net/hefrankeleyn/article/details/104891738