code: public static Long executeManualCount(Executor executor, MappedStatement countMs,
                                            Object parameter, BoundSql boundSql,
                                            ResultHandler resultHandler) throws SQLException {
          CacheKey countKey = executor.createCacheKey(countMs, parameter, RowBounds.DEFAULT, boundSql);
          BoundSql countBoundSql = countMs.getBoundSql(parameter);
          Object countResultList = executor.query(countMs, parameter, RowBounds.DEFAULT, resultHandler, countKey, countBoundSql);
          Long count = ((Number) ((List) countResultList).get(0)).longValue();
          return count;
      }
docs: 执行手动设置的 count 查询，该查询支持的参数必须和被分页的方法相同
  
  @param executor
  @param countMs
  @param parameter
  @param boundSql
  @param resultHandler
  @return
  @throws SQLException