/*
  * @see com.beike.dao.background.guest.GuestDao#validatorGuestContractNo(com.beike.form.background.guest.GuestForm)
  */
 public boolean validatorGuestContractNo(GuestForm guestForm) throws Exception {
   boolean flag = false;
   StringBuilder sql = new StringBuilder();
   sql.append("SELECT COUNT(1) FROM beiker_guest_info WHERE guest_contract_no = ? ");
   if (StringUtils.validNull(String.valueOf(guestForm.getGuestId()))) {
     sql.append(" AND guest_id != ").append(guestForm.getGuestId());
   }
   Object[] params = new Object[] {guestForm.getGuestContractNo().trim()};
   int[] types = new int[] {Types.VARCHAR};
   int count = this.getJdbcTemplate().queryForInt(sql.toString(), params, types);
   if (count > 0) {
     flag = true;
   }
   return flag;
 }