我们在用mybatis框架时,当传入的值为string类型时且需要判断时,如果用和参数为map类型的值一样的方法来写
<if test="参数名!=null and ''!=参数名“>这时查询时会报错:There is no getter for property named '参数名' in 'class java.lang.String'
找不到参数名。
想要继续判断则需要用 "_parameter"来代替参数名:
<if test="_parameter!=null and ''!=_parameter“>这样就可以了;