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},'%')