問題
今天使用MyBatis-Plus配置xml方式做模糊查詢浑塞,百度查了下資料:
參考這些資料,以上方法全部報(bào)錯(cuò) org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException好渠。
我使用的mybatis-plus版本是<version>3.0.5</version>
也不知道這些文章的作者是否有遇到相同的情況。
解決
經(jīng)過多次修改和測試,最終解決問題的代碼如下:
<if test="info.infoSummary!=null and info.infoSummary!=''">
AND a.INFO_SUMMARY LIKE concat(concat('%',#{info.infoSummary}),'%')
</if>
單引號(hào)與雙引號(hào)的區(qū)別伟桅,失之毫厘祠饺,謬以千里越驻。