.1)有这几种针对模糊查询的方式
1.${}
1.1 使用如下
<if test="stuName!=null and stuName!=''">and stuName like '%${stuName}%'</if>
1.1.1 这种方法时不推荐使用的 安全隐患问题
2.传值时,直接传%xxx% 然后使用#{值} 来接收
2.1 使用如下
student.setStuName("%p%");
<if test="stuName!=null and stuName!=''">and stuName like #{stuName}</if>
3.band标签来处理
3.1 使用如下
<bind name="_stuName" value="'%'+stuName+'%'"></bind> <if test="stuName!=null and stuName!=''">and stuName like #{_stuName}</if>
3.1.1 可以有多个bind 相当于一个中专站 处理好了的值 通过name的名称来访问