
todayWrapper.in("device_id", devIdList);
todayWrapper.likeRight("create_time", LocalDateTime.now().toLocalDate());
todayWrapper.eq("error_status", 0);
todayWrapper.in("device_id", devIdList);
todayWrapper.likeRight("create_time", LocalDateTime.now().toLocalDate());
todayWrapper.eq("error_status", 0);
使用第二段代码。会报错“Incorrect DATETIME value: '%2021-05-24'; nested exception is java.sql.SQLException: Incorrect DATETIME value: '%2021-05-24'] with root cause”,区别仅仅在于likeRight和eq的顺序
在使用todayWrapper库进行数据库查询时,将设备_id筛选范围设置为devIdList,同时使用likeRight操作创建时间并等于error_status为0时,由于likeRight和eq操作的顺序问题引发了SQL Incorrect DATETIME value的错误。问题在于时间比较的顺序影响了正确查询。

被折叠的 条评论
为什么被折叠?



