1. 程式人生 > >Mybatis 模糊查詢 like【筆記】Could not set parameters for mapping

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 '%關鍵字%'