/**
   * 설문템플릿 목록을 조회한다.
   *
   * @param searchVO
   * @param commandMap
   * @param qustnrTmplatManageVO
   * @param model
   * @return "/uss/olp/qtm/EgovQustnrTmplatManageList"
   * @throws Exception
   */
  @RequestMapping(value = "/uss/olp/qtm/EgovQustnrTmplatManageList.do")
  public String EgovQustnrTmplatManageList(
      @ModelAttribute("searchVO") ComDefaultVO searchVO,
      Map commandMap,
      QustnrTmplatManageVO qustnrTmplatManageVO,
      ModelMap model)
      throws Exception {

    String sCmd = commandMap.get("cmd") == null ? "" : (String) commandMap.get("cmd");

    if (sCmd.equals("del")) {
      egovQustnrTmplatManageService.deleteQustnrTmplatManage(qustnrTmplatManageVO);
    }

    /** EgovPropertyService.sample */
    searchVO.setPageUnit(propertiesService.getInt("pageUnit"));
    searchVO.setPageSize(propertiesService.getInt("pageSize"));

    /** pageing */
    PaginationInfo paginationInfo = new PaginationInfo();
    paginationInfo.setCurrentPageNo(searchVO.getPageIndex());
    paginationInfo.setRecordCountPerPage(searchVO.getPageUnit());
    paginationInfo.setPageSize(searchVO.getPageSize());

    searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
    searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
    searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());

    // List sampleList = egovQustnrTmplatManageService.selectQustnrTmplatManageList(searchVO);
    model.addAttribute(
        "resultList", egovQustnrTmplatManageService.selectQustnrTmplatManageList(searchVO));

    model.addAttribute(
        "searchKeyword",
        commandMap.get("searchKeyword") == null ? "" : (String) commandMap.get("searchKeyword"));
    model.addAttribute(
        "searchCondition",
        commandMap.get("searchCondition") == null
            ? ""
            : (String) commandMap.get("searchCondition"));

    int totCnt = (Integer) egovQustnrTmplatManageService.selectQustnrTmplatManageListCnt(searchVO);
    paginationInfo.setTotalRecordCount(totCnt);
    model.addAttribute("paginationInfo", paginationInfo);

    return "/uss/olp/qtm/EgovQustnrTmplatManageList";
  }
  /**
   * 설문템플릿 목록을 상세조회 조회한다.
   *
   * @param searchVO
   * @param qustnrTmplatManageVO
   * @param commandMap
   * @param model
   * @return "/uss/olp/qtm/EgovQustnrTmplatManageDetail"
   * @throws Exception
   */
  @RequestMapping(value = "/uss/olp/qtm/EgovQustnrTmplatManageDetail.do")
  public String EgovQustnrTmplatManageDetail(
      @ModelAttribute("searchVO") ComDefaultVO searchVO,
      QustnrTmplatManageVO qustnrTmplatManageVO,
      Map commandMap,
      ModelMap model)
      throws Exception {

    String sLocationUrl = "/uss/olp/qtm/EgovQustnrTmplatManageDetail";

    String sCmd = commandMap.get("cmd") == null ? "" : (String) commandMap.get("cmd");

    if (sCmd.equals("del")) {
      egovQustnrTmplatManageService.deleteQustnrTmplatManage(qustnrTmplatManageVO);
      sLocationUrl = "redirect:/uss/olp/qtm/EgovQustnrTmplatManageList.do";
    } else {
      model.addAttribute(
          "resultList",
          egovQustnrTmplatManageService.selectQustnrTmplatManageDetail(qustnrTmplatManageVO));
    }

    return sLocationUrl;
  }