🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## 一、简单统计 根据方法名来自动生成 SQL,例如: ``` long countByOpenIdAndStatus ``` ## 二、自定义语句(JPQL) ``` @Query("select count(staff) from SysStaff staff where exists (select 1 from SysStaffInvitation siv where siv.staffId=staff.staffId and siv.fromStaffId=?1 and staff.createTime like ?2% )") Integer getInvitedSysStaffListCountOfTotal(long staffId, String invitationTime); @Query("select count(staff) from SysStaff staff where exists (select 1 from SysStaffInvitation siv where siv.staffId=staff.staffId and siv.fromStaffId=?1 and staff.createTime like ?2% ) and exists (select 1 from SysStaffSetting sss where sss.staffId=staff.staffId and sss.=?3 )") Integer getInvitedSysStaffListCountOf(long staffId, String invitationTime, long identityId); ```