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



相关文章:

  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
  • 2021-08-17
  • 2022-12-23
  • 2022-12-23
  • 2022-01-24
猜你喜欢
  • 2022-12-23
  • 2021-09-27
  • 2022-12-23
  • 2022-12-23
  • 2021-06-30
  • 2022-12-23
  • 2022-01-19
相关资源
相似解决方案