如果按照这样写,
<if test="isExpired=='Y'">
and msg.expire_time < now()
</if>
会报NumberFormatException,
改成下面这种方式就可以了
<if test="isExpired=='Y'.toString()">
and msg.expire_time < now()
< /if>
转自:http://blog.youkuaiyun.com/dchjmichael/article/details/8860039