mybatis离谱bug乱转类型

字符串传入的参数被转成了int:

java 复制代码
@Param("online") String online
xml 复制代码
			<if test="online == '0'">
				and (heart_time is null or heart_time <![CDATA[ < ]]> UNIX_TIMESTAMP(SUBDATE(now(),INTERVAL 8 MINUTE)) )
			</if>
			<if test="online == '1'">
				and heart_time is not null and heart_time >= UNIX_TIMESTAMP(SUBDATE(now(),INTERVAL 8 MINUTE))
			</if>

以上代码,既不进online == '0'也不进online == '1',因为被mybatis转成了int类型。

需要这样判断:

xml 复制代码
			<if test="online == 0">
				and (heart_time is null or heart_time <![CDATA[ < ]]> UNIX_TIMESTAMP(SUBDATE(now(),INTERVAL 8 MINUTE)) )
			</if>
			<if test="online == 1">
				and heart_time is not null and heart_time >= UNIX_TIMESTAMP(SUBDATE(now(),INTERVAL 8 MINUTE))
			</if>
相关推荐
开心香辣派小星36 分钟前
23种设计模式-15解释器模式
java·设计模式·解释器模式
Halo_tjn44 分钟前
虚拟机相关实验概述
java·开发语言·windows·计算机
摆烂z1 小时前
Docker与Jib(maven插件版)实战
java
RainbowSea1 小时前
从 Spring Boot 2.x 到 3.5.x + JDK21:一次完整的生产环境迁移实战
java·spring boot·后端
笨手笨脚の1 小时前
Spring Core常见错误及解决方案
java·后端·spring
奶油松果1 小时前
Springboot自动装配 - redis和redission
java·spring boot·redis
霍夫曼2 小时前
UTC时间与本地时间转换问题
java·linux·服务器·前端·javascript
VX:Fegn08952 小时前
计算机毕业设计|基于Java人力资源管理系统(源码+数据库+文档)
java·开发语言·数据库·vue.js·spring boot·后端·课程设计
荔枝hu2 小时前
springboot和shiro组合引入SseEmitter的一些坑
java·spring boot·后端·sseeitter
老华带你飞2 小时前
健身房|基于springboot + vue健身房管理系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·后端