mybatis-plus time field comparison

mybatis-plus time field comparison, the default lt/gt/ge time comparison is invalid:

solve:

LambdaQueryWrapper<?> queryWrapper = Wrappers.<ConstantsRetention>query().lambda();
        
String strEnd= DateFormatUtils.format(dto.getEndTime(),"yyyy-MM-dd HH:mm:ss");

String start = DateFormatUtils.format(dto.getStartTime(),"yyyy-MM-dd HH:mm:ss");

queryWrapper.apply("UNIX_TIMESTAMP(tabulation_time) >= UNIX_TIMESTAMP('" + start + "')");

queryWrapper.apply("UNIX_TIMESTAMP(tabulation_time) < UNIX_TIMESTAMP('" + strEnd + "')");

Guess you like

Origin blog.csdn.net/m0_54850604/article/details/123664760