Mybatis的if test字符串比较相等问题
时间:2021-12-14 作者:匿名
网上demo
<if test="isExpired==\'Y\'"> and 域名re_time < now() </if> 会报NumberFormatException,这样就可以了。 <if test="isExpired==\'Y\'.toString()"> and 域名re_time < now() </if>
遇到不是这个问题 。
我这边实际遇到的问题
就是两个值明明相等结果就是false
后面改成这样了
<if test=’ distributionLevel==”1″ ‘>
AND 域名_id is not null
</if>