JPA专用

1. jpa 中的isnull替代方法:coalesce

@Query(value = "select coalesce(max (matter.matterIndex),'0') from AuditMatters matter where matter.parent.id = :parentId ")
String createMatterIndex(@Param("parentId") Long parentId);

@Query(value = "select coalesce(max (matter.matterIndex),'0') from AuditMatters matter where matter.parent.id is null")
String createMatterIndex();

 

posted on 2021-08-19 11:29  谦虚好学每一天  阅读(228)  评论(0)    收藏  举报

导航