mybatis报错:Error evaluating expression

报错信息

mybatis报错:Error evaluating expression ‘stu.id != null AND stu.id != ‘’’. Cause: org

mybatis的mapper文件中报了这么一个错

Error evaluating expression 'id != null AND id != '' '

sql语句如下:

<select id="xxx" parameterType="yyy" resultType="zz">
 select * from stu
 <where>
  <if test="id != null AND id != '' ">
   and id = #{id}
  </if>
  <!-- ... -->
 </where>
</select>
问题解决:if标签的test里面的表达式的and不能写成大写AND

猜你喜欢

转载自blog.csdn.net/weixin_64854388/article/details/131738785