原创

Mybatis 模糊查询 like【笔记】Could not set parameters for mapping

当使用mybatis 做模糊查询时如果这样写 会报 Could not set parameters for mapping: ParameterMapping{property='keywords' # 是起的占位符的作用,但是写在了字符串里面无法起到占位符的作用,这是我们要用 $ 这里 $ 接收内容并且连接字符串,所形成的sql  就是
select id,name from tablename where name like '%关键字%'
正文到此结束
Loading...