0
点赞
收藏
分享

微信扫一扫

Mybatis中用@Select传参数

孟佳 2022-03-30 阅读 47
java后端

一般情况

@select(“select * from user where name = #{name}”)

List selectUserByName (String name)

高级用法

@Select(“select * from userf where name like CONCAT(’%’,#{s},’%’)”)

List selectLikename(String s);

concat拼接字符串

CONCAT(’%’,#{0},’%’)") 不能直接用 ‘%#{s}%’

举报

相关推荐

0 条评论