<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="kr.co.i4way.sample.dao.SampleDao">
	<select id="getDual" resultType="java.lang.String"> 
		SELECT TO_CHAR(SYSDATE, 'YYYY-MM-DD HH24MISS') FROM DUAL
	</select>
	
	<select id="getTestList" parameterType="kr.co.i4way.sample.model.TestListVo" resultType="hashmap">
		<![CDATA[
			SELECT scr_id as Key
				,scr_id
				,scr_name
				,scr_name as Title
				,scr_link
				,grade
				,use_yn
				,depth
				,p_id
				,order_no || '' AS order_no
				,folder
			FROM TBL_MENU
 			WHERE use_yn = 'Y'
			START WITH p_id = #{param1}
			CONNECT BY PRIOR scr_id = p_id
			AND TO_NUMBER(grade) <= TO_NUMBER(#{param2})
      		ORDER SIBLINGS BY ORDER_NO
		]]>
	</select>
</mapper>