现象
mybatis if条件判断等于某个字符串,但是报错如下:
nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'D' in 'class com.projecttaskrepo.system.domain.WorkFlowLog'
代码
<if test="approveFlag == 'D'"> and approve_flag in ('Y','N') </if>
解决方法
字符串需要 .toString()
<if test="approveFlag == 'D'.toString()"> and approve_flag in ('Y','N') </if>