如何将findBy方法用于多个or(|)和(&)运算符?

时间:2018-07-03 10:57:55

标签: hibernate spring-boot spring-data-jpa jpql

对于以下sql脚本,我可以编写以下方法(findByCreateDateBetweenorRRNOrCurrency)。

Page<CustomObject> findByCreateDateBetweenAndPoutRrnOrPoutPassport(Pageable pageable, Date startDate, Date endDate, String RRN, String Currency);

其中

createDate between CONVERT(Datetime, '2018-06-29 16:17:15.763', 120) and CONVERT(Datetime, '2018-06-30 16:17:15.763', 120) 
or RRN='N0000002628607' or currency = 'AZN'



如何为下面的sql脚本编写findBy方法?

where 
createDate between CONVERT(Datetime, '2018-06-29 16:17:15.763', 120) and CONVERT(Datetime, '2018-06-30 16:17:15.763', 120) 
and (RRN='N0000002628607' or currency = 'AZN')

0 个答案:

没有答案