@RequestMapping("result")
  public ModelAndView getresult(
      @RequestParam int id,
      @RequestParam String value,
      HttpSession session,
      HttpServletRequest request) {

    logger.info("Summary of all the results");

    thresholdValuesData.put(id, value);

    ModelAndView modelAndView = new ModelAndView();
    modelAndView.setViewName("result");

    Map<Integer, String> tableNames = DataSetList.dataSetName();

    Iterator it = thresholdValuesData.entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry<Integer, String> pair = (Map.Entry) it.next();
      resultData.put(
          pair.getKey(),
          dataService.getRowByPower(
              Integer.parseInt(pair.getValue()), tableNames.get(pair.getKey())));
    }

    modelAndView.addObject("dataList", resultData);

    request.setAttribute("expertt", uName);
    request.setAttribute("tit", utitle);
    request.setAttribute("test", numberTests);
    request.setAttribute("experience", exp);
    request.setAttribute("maill", mail);

    return modelAndView;
  }
  @RequestMapping("Previous")
  public ModelAndView getoldGraphPlot(
      @RequestParam int id,
      @RequestParam int lastPage,
      @RequestParam String valuePage,
      HttpSession session) {

    logger.info("Wasserman graphs displayed for dataset-" + id);

    Map<Integer, String> tableNames = DataSetList.dataSetName();

    String tableName = tableNames.get(id);
    List<GraphPlot> oldGraphValues = dataService.getUpdatedGraphPlotList(tableName);

    session.setAttribute("idValue", id);
    session.setAttribute("dataSetnumber", id);

    ModelAndView modelAndView = new ModelAndView();
    modelAndView.setViewName("Previous");
    modelAndView.addObject("oldGraphValues", oldGraphValues);

    List<GraphPlot> thresholdValues =
        dataService.getRowByPower(Integer.parseInt(thresholdValuesData.get(id)), tableName);
    modelAndView.addObject("thresholdValues", thresholdValues);

    return modelAndView;
  }
  @RequestMapping("WassermanGraphs")
  public ModelAndView getUpdatedGraphPlot(
      @RequestParam int id,
      @RequestParam String value,
      HttpSession session,
      HttpServletRequest request) {

    logger.info("Wasserman graphs displayed for dataset-" + id);

    Map<Integer, String> tableNames = DataSetList.dataSetName();

    String tableName = tableNames.get(id);

    List<GraphPlot> graphValues = dataService.getUpdatedGraphPlotList(tableName);

    ModelAndView modelAndView = new ModelAndView();
    modelAndView.setViewName("WassermanGraphs");
    modelAndView.addObject("graphValues", graphValues);

    session.setAttribute("dataSetnumber", id);

    if (id > 1) {
      if (thresholdValuesData.containsKey(id)) {
        List<GraphPlot> thresholdValues =
            dataService.getRowByPower(Integer.parseInt(thresholdValuesData.get(id)), tableName);
        modelAndView.addObject("thresholdValues", thresholdValues);
      } else {
        thresholdValuesData.put(id - 1, value);
      }
    }

    return modelAndView;
  }
  @RequestMapping("graphplotTime")
  public ModelAndView getGraphPlot(@RequestParam int id, @RequestParam int tableId) {

    logger.info("Data fetched by time");

    Map<Integer, String> tableNames = DataSetList.dataSetName();
    String tableName = tableNames.get(tableId);
    List<GraphPlot> graphTime = dataService.getRowByTime(id, tableName);

    return new ModelAndView("graphplotTime", "graphTime", graphTime);
  }
  @RequestMapping("graphplotVO2")
  public ModelAndView getVO2(
      @RequestParam double VO2, @RequestParam double VCO2, @RequestParam int tableId) {

    logger.info("Data fetched by VO2");

    Map<Integer, String> tableNames = DataSetList.dataSetName();
    String tableName = tableNames.get(tableId);
    List<GraphPlot> graphVO2 = dataService.getRowByVO2(VO2, VCO2, tableName);

    return new ModelAndView("graphplotVO2", "graphVO2", graphVO2);
  }