code: func (session *Session) Count(bean ...interface{}) (int64, error) {
  	if session.isAutoClose {
  		defer session.Close()
  	}
  
  	var sqlStr string
  	var args []interface{}
  	var err error
  	if session.statement.RawSQL == "" {
  		sqlStr, args, err = session.statement.genCountSQL(bean...)
  		if err != nil {
  			return 0, err
  		}
  	} else {
  		sqlStr = session.statement.RawSQL
  		args = session.statement.RawParams
  	}
  
  	var total int64
  	err = session.queryRow(sqlStr, args...).Scan(&total)
  	if err == sql.ErrNoRows || err == nil {
  		return total, nil
  	}
  
  	return 0, err
  }
docs: // Count counts the records. bean's non-empty fields
  // are conditions.