select t.* from t_rule_rebate t where (merchantId IS null OR t.merchantid = #{merchantId} )AND (ztbz IS null OR trim(t.ztbz) = #{ztbz})AND (type IS null OR trim(t.type) = #{type})传进去的参数就不要在SQL中做处理了。。。。参数在传之前处理。