zoukankan      html  css  js  c++  java
  • jooq的LocalDateTime转化成LocalDate

    jooq:

    tableName.COMPLETION_TIME.cast(LocalDate.class);

    mysql sql

    // and date_format(cms_system_progress_fillin_cycle.start_time, '%Y-%m-%d') = date_format(sysdate(), '%Y-%m-%d')
    jooq:
    .and(DSL.field("date_format({0}, {1})", SQLDataType.VARCHAR, cms_system_progress_fillin_cycle.START_TIME, DSL.inline("%Y-%m-%d"))
    .eq(DSL.field("date_format({0}, {1})", SQLDataType.VARCHAR, currentTimestamp(), DSL.inline("%Y-%m-%d"))))

    mysql sql
    //        and date(sysdate()) < date(a.completion_time)
    // and date(sysdate()) >= date_sub(date(a.completion_time), interval 3 day)
    jooq:
    .and(DSL.field("date_format({0}, {1})", SQLDataType.VARCHAR, currentTimestamp(), DSL.inline("%Y-%m-%d"))
    .lt(DSL.field("date_format({0}, {1})", SQLDataType.VARCHAR, cms_system_progress_fillin_cycle.COMPLETION_TIME, DSL.inline("%Y-%m-%d"))))
    .and(DSL.field("date_format({0}, {1})", SQLDataType.VARCHAR, currentTimestamp(), DSL.inline("%Y-%m-%d"))
    .ge(DSL.field("date_format({0}, {1})", SQLDataType.VARCHAR, DSL.field(cms_system_progress_fillin_cycle.COMPLETION_TIME).sub(3), DSL.inline("%Y-%m-%d"))))

    mysql sql
    //        and date(sysdate()) < date(t.completion_time)
    // and date(sysdate()) >= date_sub(date(t.completion_time), interval 3 day)
    jooq:
    .and(DSL.currentLocalDate().lt(cms_system_progress_additional_fillin.COMPLETION_TIME.cast(LocalDate.class)))
    .and(DSL.currentLocalDate().ge(DSL.localDateTimeSub(cms_system_progress_additional_fillin.COMPLETION_TIME, 3, DatePart.DAY).cast(LocalDate.class)))



  • 相关阅读:
    ubuntu20.04上实现百度Apollo6.0系统的部署
    matplotlib包图例出现中文乱码问题
    微软官方Silverlight 音频播放器 Jonas修整版(silerlight 2.0版)
    SpringCloud总结1
    Java中文长度计算
    注册退出函数:atexit
    函数参数的一种特殊用法
    new与malloc等的区别
    两种多态
    第一章 1.1.2 因特网提供服务的方式
  • 原文地址:https://www.cnblogs.com/YuyuanNo1/p/13445020.html
Copyright © 2011-2022 走看看