关于mybatis中sql映射文件模糊查询的使用

1、从前台传递一个String类型的参数到后台进行查询,如果牵涉到模糊查询会报错,应该把参数封装到对象中再进行传递然后进行模糊查询

2、一个查询框,多个查询条件

关于mybatis中sql映射文件模糊查询的使用

<if test="customer !=null and customer !=''">
  and t.customer_name like '%#{customer}%' or t.contact_information like '%#{customer}%'
</if>