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)))



  • 相关阅读:
    Android BroadcastReceiver 接收收到短信的广播
    Android ContenObserver 监听联系人数据变化
    Android 通过AIDL在两个APP之间Service通信
    Android studio安装和问题
    Android 底部导航栏实现一 Fragment-replace
    Android ImgView属性
    Android TextView常用属性
    Android颜色配置器
    Android gravity和layout_gravity的区别
    Android 组件的三种点击事件写法
  • 原文地址:https://www.cnblogs.com/YuyuanNo1/p/13445020.html
Copyright © 2011-2022 走看看