当使用mybatis 做模糊查询时如果这样写
会报 Could not set parameters for mapping: ParameterMapping{property=‘keywords’
是起的占位符的作用,但是写在了字符串里面无法起到占位符的作用,这是我们要用 $
这里 $ 接收内容并且连接字符串,所形成的sql 就是
select id,name from tablename where name like ‘%关键字%’
作者:金字塔的旅行
来源:CSDN
原文:https://blog.csdn.net/csdn_am/article/details/79854107
版权声明:本文为博主原创文章,转载请附上博文链接!