/**
  * 기 등록 된 지식맵(지식유형)링 정보를 수정 한다.
  *
  * @param konTypeNm - 지식맵(지식유형) model
  * @return String - 리턴 Url
  * @param MapMaterialVO
  */
 @RequestMapping(value = "/dam/map/mat/EgovComDamMapMaterialModify.do")
 public String updateMapMaterial(
     @ModelAttribute("loginVO") LoginVO loginVO,
     @ModelAttribute("knoTypeCd") MapMaterial mapMaterial,
     BindingResult bindingResult,
     Map commandMap,
     ModelMap model)
     throws Exception {
   String sCmd = commandMap.get("cmd") == null ? "" : (String) commandMap.get("cmd");
   if (sCmd.equals("")) {
     MapMaterial vo = mapMaterialService.selectMapMaterial(mapMaterial);
     model.addAttribute("mapMaterial", vo);
     return "egovframework/com/dam/map/mat/EgovComDamMapMaterialModify";
   } else if (sCmd.equals("Modify")) {
     beanValidator.validate(mapMaterial, bindingResult);
     if (bindingResult.hasErrors()) {
       MapMaterial vo = mapMaterialService.selectMapMaterial(mapMaterial);
       model.addAttribute("mapMaterial", vo);
       return "egovframework/com/dam/map/mat/EgovComDamMapMaterialModify";
     }
     mapMaterial.setFrstRegisterId(loginVO.getUniqId());
     mapMaterialService.updateMapMaterial(mapMaterial);
     return "forward:/dam/map/mat/EgovComDamMapMaterialList.do";
   } else {
     return "forward:/dam/map/mat/EgovComDamMapMaterialList.do";
   }
 }
  /**
   * 지식맵(지식유형) 정보를 신규로 등록한다.
   *
   * @param konTypeNm - 지식맵(지식유형) model
   * @return String - 리턴 Url
   * @param MapMaterialVO
   */
  @RequestMapping(value = "/dam/map/mat/EgovComDamMapMaterialRegist.do")
  public String insertMapMaterial(
      @ModelAttribute("loginVO") LoginVO loginVO,
      @ModelAttribute("mapMaterial") MapMaterial mapMaterial,
      BindingResult bindingResult,
      ModelMap model)
      throws Exception {
    if (mapMaterial.getKnoTypeCd() == null || mapMaterial.getKnoTypeCd().equals("")) {

      MapTeamVO searchVO;
      searchVO = new MapTeamVO();
      searchVO.setRecordCountPerPage(999999);
      searchVO.setFirstIndex(0);
      searchVO.setSearchCondition("MapTeamList");
      List MapMaterialList = mapTeamService.selectMapTeamList(searchVO);
      model.addAttribute("mapTeam", MapMaterialList);

      return "egovframework/com/dam/map/mat/EgovComDamMapMaterialRegist";
    }

    beanValidator.validate(mapMaterial, bindingResult);
    if (bindingResult.hasErrors()) {

      MapTeamVO searchVO;
      searchVO = new MapTeamVO();
      searchVO.setRecordCountPerPage(999999);
      searchVO.setFirstIndex(0);
      searchVO.setSearchCondition("MapTeamList");
      List MapMaterialList = mapTeamService.selectMapTeamList(searchVO);
      model.addAttribute("mapTeam", MapMaterialList);

      return "egovframework/com/dam/map/mat/EgovComDamMapMaterialRegist";
    }

    mapMaterial.setFrstRegisterId(loginVO.getUniqId());
    mapMaterialService.insertMapMaterial(mapMaterial);
    return "forward:/dam/map/mat/EgovComDamMapMaterialList.do";
  }