/**
   * 우편번호를 등록한다.
   *
   * @param loginVO
   * @param zip
   * @param bindingResult
   * @param model
   * @return "egovframework/com/sym/ccm/zip/EgovCcmZipRegist"
   * @throws Exception
   */
  @RequestMapping(value = "/sym/ccm/zip/EgovCcmZipRegist.do")
  public String insertZip(
      @ModelAttribute("loginVO") LoginVO loginVO,
      @ModelAttribute("zip") Zip zip,
      ZipVO searchVO,
      BindingResult bindingResult,
      ModelMap model)
      throws Exception {

    model.addAttribute("searchList", searchVO.getSearchList());

    if (zip.getZip() == null || zip.getZip().equals("")) {

      return "egovframework/com/sym/ccm/zip/EgovCcmZipRegist";
    }

    if (searchVO.getSearchList().equals("1")) {
      beanValidator.validate(zip, bindingResult);
      if (bindingResult.hasErrors()) {
        return "egovframework/com/sym/ccm/zip/EgovCcmZipRegist";
      }

      zip.setFrstRegisterId(loginVO.getUniqId());
      zipManageService.insertZip(zip);
    } else {
      /*beanValidator.validate(zip, bindingResult);
      if (bindingResult.hasErrors()){
      	return "egovframework/com/sym/ccm/zip/EgovCcmZipRegist";
      }*/

      zip.setFrstRegisterId(loginVO.getUniqId());
      rdnmadZipService.insertZip(zip);
    }
    return "forward:/sym/ccm/zip/EgovCcmZipList.do";
  }
  /**
   * 우편번호를 수정한다.
   *
   * @param loginVO
   * @param zip
   * @param bindingResult
   * @param commandMap
   * @param model
   * @return "egovframework/com/sym/ccm/zip/EgovCcmZipModify"
   * @throws Exception
   */
  @RequestMapping(value = "/sym/ccm/zip/EgovCcmZipModify.do")
  public String updateZip(
      @ModelAttribute("loginVO") LoginVO loginVO,
      @ModelAttribute("zip") Zip zip,
      ZipVO searchVO,
      BindingResult bindingResult,
      @RequestParam Map<String, Object> commandMap,
      ModelMap model)
      throws Exception {
    String sCmd = commandMap.get("cmd") == null ? "" : (String) commandMap.get("cmd");
    model.addAttribute("searchList", searchVO.getSearchList());
    if (sCmd.equals("")) {
      if (searchVO.getSearchList().equals("1")) {
        Zip vo = zipManageService.selectZipDetail(zip);
        model.addAttribute("zip", vo);
      } else {
        Zip vo = rdnmadZipService.selectZipDetail(zip);
        model.addAttribute("zip", vo);
      }
      return "egovframework/com/sym/ccm/zip/EgovCcmZipModify";
    } else if (sCmd.equals("Modify")) {
      if (searchVO.getSearchList().equals("1")) {
        beanValidator.validate(zip, bindingResult);
        if (bindingResult.hasErrors()) {
          return "egovframework/com/sym/ccm/zip/EgovCcmZipModify";
        }

        zip.setLastUpdusrId(loginVO.getUniqId());
        zipManageService.updateZip(zip);
      } else {
        /*beanValidator.validate(zip, bindingResult);
        if (bindingResult.hasErrors()){
        	return "egovframework/com/sym/ccm/zip/EgovCcmZipModify";
        }*/

        zip.setLastUpdusrId(loginVO.getUniqId());
        rdnmadZipService.updateZip(zip);
      }

      return "forward:/sym/ccm/zip/EgovCcmZipList.do";
    } else {
      return "forward:/sym/ccm/zip/EgovCcmZipList.do";
    }
  }