在navicat16中,标准写法
SELECT * FROM business_status_info
WHERE create_time > (NOW() - INTERVAL '5 minutes')
在mybatis中,错误写法
SELECT * FROM business_status_info
WHERE create_time > (NOW() - INTERVAL#{monitorTimeInterval,jdbcType=INTEGER} ' minutes')
错误如下:
以上写法,相当于:
正确写法:
SELECT * FROM business_status_info
WHERE create_time > (NOW() - INTERVAL '1 minute' *5)
mybatis:
SELECT * FROM business_status_info
WHEREcreate_time > (NOW() - INTERVAL '1 minute' * #{monitorTimeInterval,jdbcType=INTEGER})