mybatis-プラス時間フィールドの比較

mybatis-plus時間フィールド比較、デフォルトのlt / gt / ge時間比較は無効です:

解決する:

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 + "')");

おすすめ

転載: blog.csdn.net/m0_54850604/article/details/123664760