更新时间:2023-11-29 12:37:16
你应该看看 参考文档.解释的很好.
You should take a look the reference documentation. It's well explained.
在你的情况下,我认为你不能使用 between 因为你需要传递两个参数
In your case, I think you cannot use between because you need to pass two parameters
Between - findByStartDateBetween ... 其中 x.startDate 介于 ?1 和 ?2 之间
Between - findByStartDateBetween … where x.startDate between ?1 and ?2
在您的情况下,请考虑使用 LessThan
或 LessThanEqual
与 GreaterThan
或 GreaterThanEqual
In your case take a look to use a combination of LessThan
or LessThanEqual
with GreaterThan
or GreaterThanEqual
LessThan - findByEndLessThan ... 其中 x.start1
LessThan - findByEndLessThan … where x.start< ?1
LessThanEqual findByEndLessThanEqual ... where x.start
LessThanEqual findByEndLessThanEqual … where x.start <= ?1
GreaterThan - findByStartGreaterThan ... where x.end>?1
GreaterThan - findByStartGreaterThan … where x.end> ?1
GreaterThanEqual - findByStartGreaterThanEqual ... where x.end>= ?1
GreaterThanEqual - findByStartGreaterThanEqual … where x.end>= ?1
您可以使用运算符 And
和 Or
将两者结合起来.
You can use the operator And
and Or
to combine both.