src/org/nutz/dao/impl/sql/SqlTemplate.java
public long queryForLong(String sql, Map<String, Object> vars, Map<String, Object> params) {
        Sql sqlObj = createSqlObj(sql, params);
        sqlObj.setCallback(Sqls.callback.longValue());
        execute(sqlObj, vars, params);
        Long result = sqlObj.getObject(Long.class);
        return result == null ? 0 : result;
    }
public long queryForLong(String sql, Map<String, Object> vars, Map<String, Object> params) {
        Sql sqlObj = createSqlObj(sql, params);
        sqlObj.setCallback(Sqls.callback.longValue());
        execute(sqlObj, vars, params);
        Long result = sqlObj.getObject(Long.class);
        return result == null ? 0 : result;
    }
执行一个SQL查询操作，结果为一个long形数值。

@param sql
包含变量占位符的SQL
@param vars
变量map，无参数时，可为null
@param params
参数map，无参数时，可为null

@return long数值，当查询为null时返回0