@Override
public List<BhOrder1> findAll(Integer status, Date createTime){
//条件
SpecificationBuilder<BhOrder1> entitySpecificationBuilder = new SpecificationBuilder<>();
//状态
if (status != null){
entitySpecificationBuilder.with("status", "like", status, false);
}
entitySpecificationBuilder.with("createTime", ">", createTime, false);
List<BhOrder1> content = bhOrder1Repository.findAll(entitySpecificationBuilder.build());
return content;
}
当查询小于当前时间就会报错
但是当查询等于当前时间就可以查询出来
用timestamp代替date
https://blog.csdn.net/java_ying/article/details/79656806
SpecificationBuilder是你自己封装的吗?with是怎么实现的?代码是什么?
可以试下将findAll(Integer status, Date createTime)的Date改为Timestamp。然后实体类是的createTime类型也改为Timestamp。