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>
相关推荐
shan&cen6 分钟前
Day04 前缀和&差分 1109. 航班预订统计 、304. 二维区域和检索 - 矩阵不可变
java·数据结构·算法
在线教学养猪15 分钟前
Spring Task
java·后端·spring
_hermit:19 分钟前
【从零开始java学习|小结】记录学习和编程中的问题
java·学习
小柯J桑_20 分钟前
C++之特殊类设计
java·开发语言·c++
菜鸟plus+24 分钟前
Java NIO
java·nio
君不见,青丝成雪24 分钟前
Java中IntStream的详细用法及典型案例
java
QiZhang | UESTC25 分钟前
JAVA算法练习题day11
java·开发语言·python·算法·hot100
FenceRain25 分钟前
spring boot 拦截器增加语言信息
java·spring boot·后端
星月前端26 分钟前
idea没法识别springboot项目的一个原因解决及办法
java·spring boot·intellij-idea
爱笑的源码基地27 分钟前
智慧城管源码,java版城管综合执法监督系统微服务源码
java·源码·软件开发·智慧城管·城管执法系统·数字城管·城管综合管理系统