码迷,mamicode.com
首页 > 其他好文 > 详细

在mybatis中模糊查询有三种写法

时间:2017-10-15 22:26:31      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:--   student   字符   val   模糊   模糊查询   core   mybatis   查询   

<select id="selectStudentsByName" resultType="Student">

  <!--第一种-->
    <!-- select id,name,age,score from student where name like ‘%‘ #{0} ‘%‘ -->

  <!--第二种-->
  <!-- select id,name,age,score from student where name like concat(‘%‘, #{0}, ‘%‘) -->

       <!--第三种-->
  <!--‘%${value}%‘ :为字符串拼接 -->
  select id,name,age,score from student where name like ‘%${value}%‘
</select>

在mybatis中模糊查询有三种写法

标签:--   student   字符   val   模糊   模糊查询   core   mybatis   查询   

原文地址:http://www.cnblogs.com/hwgok/p/7674380.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!