spring data jpa中使用count计数方法很简单

直接在dao层写方法即可



int countByUidAndTenementId(String parentUid, String tenementId);


这样即可根据传入的字段查询即可。