當使用mybatis 做模糊查詢時如果這樣寫
會報 Could not set parameters for mapping: ParameterMapping{property='keywords'
# 是起的占位符的作用,但是寫在了字符串里面無法起到占位符的作用,這是我們要用 $
這里 $ 接收內容並且連接字符串,所形成的sql 就是
select id,name from tablename where name like '%關鍵字%'
當使用mybatis 做模糊查詢時如果這樣寫
會報 Could not set parameters for mapping: ParameterMapping{property='keywords'
# 是起的占位符的作用,但是寫在了字符串里面無法起到占位符的作用,這是我們要用 $
這里 $ 接收內容並且連接字符串,所形成的sql 就是
select id,name from tablename where name like '%關鍵字%'
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。