在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>

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