isFlag 是String类型,判断等于Y <if test="isFlag!=null and isFlag=='Y'.toString()"> Y用单引号需要toString,否则mybatis会当成int型处理,或者用双引号 相关文章: