JPA的计数查询

 这种格式的查询 可以不用写sql

int countBySupEngCode(String supEngCode);



  • 确认你的dao层继承的是JpaRepository
  • countByOpenIdAndStatus【count,By,And】是固定格式哦
  • 返回值一定是int,否则会报错的