如下SQL:
select * from sales_account t where (t.id = 2143 or t.id = 2142)
java spring data jpa 写法:
代码片段:
List<Predicate> predicates = new ArrayList<>();
predicates.add(
criteriaBuilder.or(
criteriaBuilder.equal(root.get("id"), 2143 ),
criteriaBuilder.equal(root.get("id"), 2142)
)
);