mybatis set遇到坑: BuilderException: Error evaluating expression ‘shr ! = ‘‘ ,shr是关键字!

update tableName
<set>
  <if test="shr!=null or shr !='' ">
     shr = #{shr},
  if>
  .........
<set>
Caused by: org.apache.ibatis.builder.BuilderException: Error evaluating expression 'shr ! = ''and  shr !=null'. Cause: org.apache.ibatis.ognl.ExpressionSyntaxException: Malformed OGNL expression: 'shr ! = ''and  shr !=null'[org.apache.ibatis.ognl.ParseException: Encountered " "shr"
Was expecting one of:
    <EOF> 
    "," ...
    "=" ...
    "?" ...
    "||" ...
    "or" ...
    "&&" ...
    "and" ...
    "shr" ...

我的实体类中有字段shr,自定义审核人的意思,但是shr在mybatis中被认为是关键字,改个名字就好了
。。。真的坑 所以说不要懒用拼音。。。

你可能感兴趣的:(MyBatis,mybatis)