1.从前台传递一个String类型的参数到后台进行查询,如果牵涉到模糊查询会报错,应该把参数封装到对象中再进行传递然后进行模糊查询 2.一个查询框,多个查询条件 <if test="customer !=null and customer !=''"> and t.customer_name like '%#{customer}%' or t.contact_information like '%#{customer}%' </if>…
第一种 concat select * from cat_table where cat_name like concat(#{catName},'%') --单个百分号 select * from cat_table where cat_name like concat(concat('%',#{catName}),'%') --前后百分号 第二种 || select * from cat_table where cat_name like '%' || #{catName} || '%' 第…