/**
   * 설문문항 목록을 조회한다.
   *
   * @param searchVO
   * @param qustnrQestnManageVO
   * @param commandMap
   * @param model
   * @return "egovframework/com/uss/olp/qqm/EgovQustnrQestnManageList"
   * @throws Exception
   */
  @IncludedInfo(name = "질문관리", order = 630, gid = 50)
  @RequestMapping(value = "/uss/olp/qqm/EgovQustnrQestnManageList.do")
  public String egovQustnrQestnManageList(
      @ModelAttribute("searchVO") ComDefaultVO searchVO,
      @ModelAttribute("qustnrQestnManageVO") QustnrQestnManageVO qustnrQestnManageVO,
      Map commandMap,
      ModelMap model)
      throws Exception {
    // 0. Spring Security 사용자권한 처리
    Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
    if (!isAuthenticated) {
      model.addAttribute("message", egovMessageSource.getMessage("fail.common.login"));
      return "egovframework/com/uat/uia/EgovLoginUsr";
    }

    // 로그인 객체 선언
    LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();

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

    if (sCmd.equals("del")) {
      egovQustnrQestnManageService.deleteQustnrQestnManage(qustnrQestnManageVO);
    }

    // 설문지정보에서 넘어오면 자동검색 설정
    if (sSearchMode.equals("Y")) {
      searchVO.setSearchCondition("QESTNR_ID");
      searchVO.setSearchKeyword(qustnrQestnManageVO.getQestnrId());
    }

    /** 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 = egovQustnrQestnManageService.selectQustnrQestnManageList(searchVO);
    model.addAttribute("resultList", sampleList);

    int totCnt = (Integer) egovQustnrQestnManageService.selectQustnrQestnManageListCnt(searchVO);
    paginationInfo.setTotalRecordCount(totCnt);
    model.addAttribute("paginationInfo", paginationInfo);

    return "egovframework/com/uss/olp/qqm/EgovQustnrQestnManageList";
  }
  /**
   * 설문문항 팝업 록을 조회한다.
   *
   * @param searchVO
   * @param qustnrQestnManageVO
   * @param commandMap
   * @param model
   * @return "egovframework/com/uss/olp/qqm/EgovQustnrQestnManageListPopup"
   * @throws Exception
   */
  @RequestMapping(value = "/uss/olp/qqm/EgovQustnrQestnManageListPopup.do")
  public String egovQustnrQestnManageListPopup(
      @ModelAttribute("searchVO") ComDefaultVO searchVO,
      @ModelAttribute("qustnrQestnManageVO") QustnrQestnManageVO qustnrQestnManageVO,
      Map commandMap,
      ModelMap model)
      throws Exception {

    String sSearchMode =
        commandMap.get("searchMode") == null ? "" : (String) commandMap.get("searchMode");

    // 설문지정보에서 넘어오면 자동검색 설정
    if (sSearchMode.equals("Y")) {
      searchVO.setSearchCondition("QESTNR_ID");
      searchVO.setSearchKeyword(qustnrQestnManageVO.getQestnrId());
    }

    /** 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 resultList = egovQustnrQestnManageService.selectQustnrQestnManageList(searchVO);
    model.addAttribute("resultList", resultList);

    int totCnt = (Integer) egovQustnrQestnManageService.selectQustnrQestnManageListCnt(searchVO);
    paginationInfo.setTotalRecordCount(totCnt);
    model.addAttribute("paginationInfo", paginationInfo);

    return "egovframework/com/uss/olp/qqm/EgovQustnrQestnManageListPopup";
  }