根据前端传的时间查询数据


后端:

实体:AppointmentDto中的 startDate、endDate

/**
 * 开始时间
 */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime startDate;
/**
 * 结束时间
 */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endDate;

appointmentDto作为实体类对象

if (appointmentDto.getStartDate() != null || appointmentDto.getEndDate() != null) {
    QueryWrapper<Appointment> queryWrapper = new QueryWrapper<>();
    queryWrapper.ge("appointment_time", appointmentDto.getStartDate());
    queryWrapper.le("appointment_time", appointmentDto.getEndDate());
}

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM