<?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="com.style24.core.biz.dao.TscClauseDao">

	<!-- 약관 정보  -->
	<select id="getClause" parameterType="Clause" resultType="String">
		/* TscClause.getClause */
		SELECT CLAUSE_CONTENT
		FROM   TB_CLAUSE A
		WHERE  CLAUSE_SQ = (
		                    SELECT MAX(CLAUSE_SQ)
		                    FROM   TB_CLAUSE
		                    WHERE  SITE_CD = #{siteCd}
		                    AND    CLAUSE_TYPE = #{clauseType}
		                    AND    DISP_YN = 'Y'
		                   )
	</select>

	<!-- 약관 정보 목록 -->
	<select id="getClauseList" parameterType="Clause" resultType="Clause">
		/* TscClause.getClause */
		SELECT CLAUSE_SQ
		     , CLAUSE_TITLE
		     , CLAUSE_CONTENT
		FROM   TB_CLAUSE
		WHERE  SITE_CD = #{siteCd}
		AND    CLAUSE_TYPE = #{clauseType}
		AND    DISP_YN = 'Y'
		ORDER BY CLAUSE_SQ DESC
	</select>

	<!-- 약관 정보 -->
	<select id="getClauseInfo" parameterType="Integer" resultType="Clause">
		SELECT CLAUSE_CONTENT
		FROM   TB_CLAUSE
		WHERE  CLAUSE_SQ = #{clauseSq}
	</select>

</mapper>
