public int findCountByUserId(String userId) {
   List<Pay> list = payDao.find("select * from pay where user_id = ?", userId);
   if (null != list && !list.isEmpty()) {
     return list.size();
   }
   return 0;
 }
 public Pay save(Pay pay) {
   if (pay == null) {
     return null;
   }
   pay.save();
   return pay;
 }
 public Page<Pay> paginate(int pageNumber, int pageSize) {
   return payDao.paginate(
       pageNumber,
       pageSize,
       "select p.*,u.name",
       "from pay p inner join user u where u.id = p.user_id order by id asc");
 }
 public void deleteById(String id) {
   payDao.deleteById(id);
 }
 public Pay findById(String id) {
   Pay pay = payDao.findById(id);
   return pay;
 }
 public void update(Pay pay) {
   if (pay == null) {
     return;
   }
   pay.update();
 }