controller中jpql在使用case表达式的时候出现问题

控制台报错:
image
jpql语句:
image
请问出现出现这个原因的问题是什么,是我的代码写的有问题吗

错误提示比较明显,是JPQL 语法错误。

image
能否指正一下错在什么地方

定位到具体问题为:jpql支不支持在where条件里写case when,还请麻烦解答一下

你的 jpql 可以改成这样:

((:beginTime is not null and e.releaseTime >= :beginTime) or :beginTime is null) and 
((:endTime is not null and e.releaseTime <= :endTime) or :endTime is null)
1 个赞

多谢多谢