<!--条件查询--> <select id="selectone" resultType="pojo.DishEnpty"> select * from dish <where> <if test="type!=null and type !=''"> type=#{type} </if> <if test="name!=null and name!=''"> name like #{name} </if> </where> </select>