您当前的位置: 首页 >  I.T10001 mybatis

mybatis模糊查询之Like(3)

I.T10001 发布时间:2020-01-13 09:25:46 ,浏览量:5

mybatis模糊查询之Like方法

1.  参数中直接加入%%

  param.setUsername("%CD%");

      param.setPassword("%11%");

select id,sex,age,username,password from person where true AND username LIKE #{username} AND password LIKE #{password}

2.  bind标签

select id,sex,age,username,password from person where username LIKE #{pattern}

 

 

3. CONCAT

where username LIKE concat(concat('%',#{username}),'%')

 

关注
打赏
1688896170
查看更多评论

I.T10001

暂无认证

  • 5浏览

    0关注

    154博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.0458s