<?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="RisDAO">
    
    <select id="selectRisInfo" parameterType="RisVO" resultType="RisVO">
    /* CollectionDAO.selectRisInfo RIS다운로드를 위한 자료 정보 조회 */
        SELECT 
             *
        FROM
             RG_MASTER RM
            WHERE 1=1
            AND MASTER_ID = #{masterId} 
    </select>
    
    <select id="selectOrgList" resultType="DeptVO" >
    /* CollectionDAO.selectOrgList 문화원 목록 조회 (검색 필터용) */
       <![CDATA[  
       SELECT 
              ORG_CD
             ,DEPT_NM
        FROM
            SM_DEPT SD
            INNER JOIN
            RG_MASTER RM 
            ON SD.ORG_CD = RM.MNG_ORG_CD 
          WHERE 1=1
           AND SD.USE_YN = "Y"
           AND SD.CLOSE_FLAG = "0"
           AND IFNULL(NULLIF(SD.APPLY_START_YMD,''),"99999999") < date_format(NOW(), '%Y%m%d')
           AND IFNULL(NULLIF(SD.APPLY_CLOSE_YMD,''),"99999999") > date_format(NOW(), '%Y%m%d')
           GROUP BY ORG_CD,DEPT_NM
           ORDER BY ORG_CD
     ]]>
    </select>
</mapper>