MyBatis模糊查詢LIKE

FeelTouch發表於2018-07-10
1.表示式: name like"%"#{name}"%"
==>  Preparing: select * from bbs_brand WHERE namelike"%"?"%"and falg=? limit 0 , 10
==>Parameters: 999(String), 1(Integer)

 
2.表示式: name like '%${name}%'
Preparing:select count(0) from (select * from bbs_brand WHERE name like'%999%' and falg=?) as total
Parameters: 1(Integer)


3. 表示式: name likeconcat(concat('%',#{username}),'%')
==>  Preparing: select count(0) from (select *from bbs_brand WHERE name like
 concat(concat('%',?),'%') and falg=?) as total
==>Parameters: 999(String), 1(Integer)


3. 表示式:name like CONCAT('%','${name}','%')
==>  Preparing: select count(0) from (select *from bbs_brand WHERE name likeCONCAT('%','999','%') and falg=?) astotal
==>Parameters: 1(Integer)

相關文章