diff --git a/src/main/java/nlib/info/service/InformService.java b/src/main/java/nlib/info/service/InformService.java index 3b51dce6..146d40b2 100644 --- a/src/main/java/nlib/info/service/InformService.java +++ b/src/main/java/nlib/info/service/InformService.java @@ -51,7 +51,7 @@ public interface InformService /* * 이용안내를 조회한다. */ - public HashMap> selectNCultureOperationInfo(String councilCd) throws Exception ; + public HashMap selectNCultureOperationInfo(String councilCd) throws Exception ; /* * 찾아오는길 조회한다. diff --git a/src/main/java/nlib/info/service/impl/InformDAO.java b/src/main/java/nlib/info/service/impl/InformDAO.java index f4e32a2f..01216058 100644 --- a/src/main/java/nlib/info/service/impl/InformDAO.java +++ b/src/main/java/nlib/info/service/impl/InformDAO.java @@ -4,6 +4,7 @@ import java.util.HashMap; import java.util.List; import egovframework.rte.psl.dataaccess.mapper.Mapper; +import org.apache.ibatis.annotations.Param; /** *
@@ -37,11 +38,13 @@ public interface InformDAO
 	 * @param reqVO
 	 * @return
 	 */
-	public HashMap selectInfoContent(String conDivAndCounCd) throws Exception;
+	public HashMap selectInfoContent(@Param("mngOrgCd") String mngOrgCd, @Param("contentType") String contentType) throws Exception;
 
-	public HashMap selectOperationEnv(String councilCd) throws Exception;
+	public HashMap selectOperationEnv(String orgCd) throws Exception;
 	
-	public HashMap selectNCultureAddr(String councilCd) throws Exception;
+	public HashMap selectNCultureAddr(String orgCd) throws Exception;
+	
+	public HashMap selectNCultureOpenTime(String orgCd) throws Exception;
 	
 	
 }
diff --git a/src/main/java/nlib/info/service/impl/InformServiceImpl.java b/src/main/java/nlib/info/service/impl/InformServiceImpl.java
index b4f65aa2..8bf747d7 100644
--- a/src/main/java/nlib/info/service/impl/InformServiceImpl.java
+++ b/src/main/java/nlib/info/service/impl/InformServiceImpl.java
@@ -47,14 +47,12 @@ public class InformServiceImpl implements InformService
 	/* 
 	 * 이용약관을 조회한다. 
 	 * 
-	 * (non-Javadoc)
-	 * @see nlib.info.service.InformService#selectTermsInfo(nlib.restful.service.DataApiReqVO)
 	 */
-	public HashMap selectInfoContent(String councilCd, String contentType) throws Exception {
+	public HashMap selectInfoContent(String orgCd, String contentType) throws Exception {
 		
-		if(StringUtil.isEmpty(councilCd)) councilCd = NlibProperty.getString("nlib.council.cd");
+		if(StringUtil.isEmpty(orgCd)) orgCd = NlibProperty.getString("nlib.council.cd");
 		
-		HashMap ret = informDAO.selectInfoContent(contentType + "@" + councilCd); // conDivAndCounCd
+		HashMap ret = informDAO.selectInfoContent(orgCd, contentType);
 		if(ret == null) {
 			ret = new HashMap();
 			ret.put("TITLE", "(없음)");
@@ -70,9 +68,9 @@ public class InformServiceImpl implements InformService
 	 * (non-Javadoc)
 	 * @see nlib.info.service.InformService#selectTermsInfo(nlib.restful.service.DataApiReqVO)
 	 */
-	public HashMap  selectTermsInfo(String councilCd) throws Exception {
+	public HashMap  selectTermsInfo(String orgCd) throws Exception {
 		
-		return selectInfoContent(councilCd, "TERMS");
+		return selectInfoContent(orgCd, "TERMS");
 	}
 
 	/* 
@@ -81,9 +79,9 @@ public class InformServiceImpl implements InformService
 	 * (non-Javadoc)
 	 * @see nlib.info.service.InformService#selectPrivacyInfo(nlib.restful.service.DataApiReqVO)
 	 */
-	public HashMap  selectPrivacyInfo(String councilCd) throws Exception {
+	public HashMap  selectPrivacyInfo(String orgCd) throws Exception {
 
-		return selectInfoContent(councilCd, "PRIVACY");
+		return selectInfoContent(orgCd, "PRIVACY");
 	}
 
 	/* 
@@ -92,37 +90,40 @@ public class InformServiceImpl implements InformService
 	 * (non-Javadoc)
 	 * @see nlib.info.service.InformService#selectGreeting(nlib.restful.service.DataApiReqVO)
 	 */
-	public HashMap selectGreeting(String councilCd) throws Exception {
+	public HashMap selectGreeting(String orgCd) throws Exception {
 
-		return selectInfoContent(councilCd, "GREETING");
+		return selectInfoContent(orgCd, "GREETING");
 	}
 
 	/* 
 	 * 이용안내를 조회한다. 
 	 * 
-	 * (non-Javadoc)
-	 * @see nlib.info.service.InformService#selectNCultureOperationInfo(nlib.restful.service.DataApiReqVO)
 	 */
-	public HashMap> selectNCultureOperationInfo(String councilCd) throws Exception {
+	public HashMap selectNCultureOperationInfo(String orgCd) throws Exception {
 
-		HashMap> operationInfo = new HashMap>();
+		HashMap operationInfo = new HashMap();
 		
-		HashMap envValues = informDAO.selectOperationEnv(councilCd);
+		HashMap envValues = informDAO.selectOperationEnv(orgCd);
 		
-		//-----------------------------
-		// 전체 문화원 공통 사항 
-		//-----------------------------
-		// 대출안내
+		// 대출안내 : 전체 문화원 공통 사항 
 		HashMap operation = selectInfoContent(NlibProperty.getString("nlib.council.cd"), "OPERATION");
-		if(envValues != null && operation != null && operation.get("CONTENT") != null) {
-			String content = operation.get("CONTENT");
+		String content = (operation != null ? operation.get("CONTENT") : "");
+		
+		if(envValues != null && StringUtil.isNotEmpty(content)) {
+			
 			for(String key : envValues.keySet()) {
 				content = content.replaceAll("%" + key + "%", StringUtil.getString(envValues.get(key), ""));
 			}
-			operation.put("CONTENT", content);
 		}
 		
-		operationInfo.put("OPERATION", operation);
+		// 문화원별 개폐시간 및 휴관일 
+		HashMap openTime = informDAO.selectNCultureOpenTime(orgCd);
+		
+		operationInfo.put("informTitle"   , (operation != null ? operation.get("TITLE") : ""));
+		operationInfo.put("informContent" , content);
+		operationInfo.put("openTime"      , (openTime != null ? openTime.get("OPEN_TIME") : ""));
+		operationInfo.put("closeTime"     , (openTime != null ? openTime.get("CLOSED_TIME") : ""));
+		operationInfo.put("closingInfo"   , (openTime != null ? openTime.get("CLOSING_INFO") : ""));
 		
 		return operationInfo;
 	}
diff --git a/src/main/java/nlib/info/web/InformController.java b/src/main/java/nlib/info/web/InformController.java
index ae9d7959..112907a0 100644
--- a/src/main/java/nlib/info/web/InformController.java
+++ b/src/main/java/nlib/info/web/InformController.java
@@ -123,10 +123,13 @@ public class InformController extends NlibCommonController {
 	@RequestMapping("/inform/selectNCultureOperationInfo.do")
 	public String selectNCultureOperationInfo(HttpServletRequest request, Authentication authentication, ModelMap model) throws Exception {
 
-    	HashMap> ret = informService.selectNCultureOperationInfo(getCurCouncilCd(request));
-
-    	model.addAttribute("informTitle",    ret.get("TITLE"));
-    	if(ret.get("OPERATION") != null) model.addAttribute("informContent", ((HashMap)ret.get("OPERATION")).get("CONTENT"));
+    	// 이용안내 내용 
+    	HashMap ret = informService.selectNCultureOperationInfo(getCurCouncilCd(request));
+    	model.addAttribute("informTitle",   ret.get("informTitle"));
+    	model.addAttribute("informContent", ret.get("informContent"));
+    	model.addAttribute("openTime",      ret.get("openTime"));
+    	model.addAttribute("closeTime",     ret.get("closeTime"));
+    	model.addAttribute("closingInfo",   ret.get("closingInfo"));
 
 		return "nlib/inform/selectNCultureOperationInfo";
 	}
diff --git a/src/main/resources/egovframework/mapper/nlib/info/InformDAO_SQL.xml b/src/main/resources/egovframework/mapper/nlib/info/InformDAO_SQL.xml
index 91fede1a..d7ee6f9f 100644
--- a/src/main/resources/egovframework/mapper/nlib/info/InformDAO_SQL.xml
+++ b/src/main/resources/egovframework/mapper/nlib/info/InformDAO_SQL.xml
@@ -12,12 +12,21 @@
 		    , CONTENT
 		    , BD_ATTACH_FILE_ATTACH_FILE_ID
 		FROM BD_NLIB_CONTENT_PAGE A
-		WHERE A.CONTENT_TYPE = SUBSTRING(#{conDivAndCounCd}, 1, INSTR(#{conDivAndCounCd}, '@') - 1)
-		AND A.MNG_ORG_CD = SUBSTRING(#{conDivAndCounCd}, INSTR(#{conDivAndCounCd}, '@') + 1)
+		WHERE A.CONTENT_TYPE = #{contentType}
+		AND A.MNG_ORG_CD = #{mngOrgCd}
  	
  	
+    
+ 	
  	
  	
diff --git a/src/main/webapp/WEB-INF/jsp/nlib/inform/selectNCultureOperationInfo.jsp b/src/main/webapp/WEB-INF/jsp/nlib/inform/selectNCultureOperationInfo.jsp
index a5d195ba..cdde0748 100644
--- a/src/main/webapp/WEB-INF/jsp/nlib/inform/selectNCultureOperationInfo.jsp
+++ b/src/main/webapp/WEB-INF/jsp/nlib/inform/selectNCultureOperationInfo.jsp
@@ -70,13 +70,13 @@ $( document ).ready(function() {
                         

운영시간

-

오전9:00 - 오후6:00

+

오전${openTime } - 오후${closeTime }

평일 (월요일 ~ 금요일) 운영

휴관일

매주 토, 일요일 휴관

-

관공서의 휴관일 및 국가가 정한 임시 공휴일 휴관

+

${closingInfo }