<?xml version="1.0" encoding="UTF-8"?><!--Converted at: Wed May 11 15:49:38 KST 2016-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="nlib.info.service.impl.InformDAO">

 	<select id="selectInfoContent" parameterType="String" resultType="HashMap">
		SELECT
		      CONTENT_ID
		    , CONTENT_TYPE
		    , MNG_ORG_CD
		    , TITLE
		    , CONVERT(A.CONTENT_LBL USING UTF8) AS CONTENT
		FROM BD_NLIB_CONTENT_PAGE A
		WHERE A.CONTENT_TYPE = #{contentType}
		AND A.MNG_ORG_CD = #{mngOrgCd}
 	</select>
 	
    <select id="selectNCultureOpenTime" parameterType="String" resultType="HashMap">
        SELECT
              OPEN_TIME
            , CLOSED_TIME
            , CLOSING_INFO
        FROM SM_DEPT A
        WHERE A.ORG_CD = #{orgCd}
    </select>
 	
 	<select id="selectOperationEnv" parameterType="String" resultType="HashMap">
 	    <!-- Param : orgCd -->
		SELECT 
		      MAX(CASE WHEN GUBUN = 'MAX_LEND_DAYS'  THEN ENV_VAL ELSE NULL END) AS MAX_LEND_DAYS
		    , MAX(CASE WHEN GUBUN = 'MAX_LEND_COUNT' THEN ENV_VAL ELSE NULL END) AS MAX_LEND_COUNT 
		FROM(
		    SELECT 'MAX_LEND_DAYS' AS GUBUN, ENV_VAL
		    FROM SM_ENV
		    WHERE ENV_ID = 'MAX_LEND_DAYS'
		    UNION ALL 
		    SELECT  'MAX_LEND_COUNT' AS GUBUN, ENV_VAL
		    FROM SM_ENV
		    WHERE ENV_ID = 'MAX_LEND_COUNT'
		) A 
 	</select>
 	  
    <select id="selectNCultureAddr" parameterType="String" resultType="HashMap">
        SELECT
              DEPT_NM 
            , ADDRESS
            , ADDRESS_DETAIL
            , ZIP_CODE
            , PHONE_NO
            , FAX_NO
            , LATITUDE
            , LONGITUDE
            , OPEN_TIME
            , CLOSED_TIME
            , CLOSING_INFO
        FROM SM_DEPT A
        WHERE ORG_CD = #{orgCd}
        LIMIT 1 
    </select>
 	
</mapper>