首页 > 其他 > 详细

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

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

<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中模糊查询有三种写法

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!