mybatis中传入字符串比较大小
<mapper namespace="com.example.mapper.YourEntityMapper">
<select id="selectByTimeRange" resultType="com.example.model.YourEntity">
SELECT *
FROM your_entity_table
WHERE
(
update_time IS NOT NULL AND
update_time BETWEEN STR_TO_DATE(#{startTimeStr}, '%Y-%m-%d %H:%i:%s') AND STR_TO_DATE(#{endTimeStr}, '%Y-%m-%d %H:%i:%s')
) OR
(
update_time IS NULL AND
create_time BETWEEN STR_TO_DATE(#{startTimeStr}, '%Y-%m-%d %H:%i:%s') AND STR_TO_DATE(#{endTimeStr}, '%Y-%m-%d %H:%i:%s')
)
</select>
</mapper>
原文地址:https://blog.csdn.net/qq_38958829/article/details/143808654
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!