1、报错信息
caused by: org.apache.ibatis.builder.BuilderException : Error evaluating expression ''
xxxxxxxxx
xxxxxxxxx
2、我遇到的报错场景
传入:type==null
@Param("s") 实体类
<if test="s.type !=null">
and type=#{s.type}
</if>
3、解决方法
在外面增加一层判断—
<if test="s !=null ">
<if test="s.type !=null">
and type=#{s.type}
</if>
</if>
或者这样写
<if test="s !=null and s.type !=null">
and type=#{s.type}
</if>