<?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.trade.client.advocacypage.mapper.CreditScoreQuotaMapper">

	<resultMap id="BaseResultMap" type="com.trade.client.advocacypage.domain.CreditScoreQuota">
		<id column="currency_code" property="currencyCode" />
		<id column="end_score" property="endScore" />
		<id column="gmt_create" property="gmtCreate" />
		<id column="gmt_modified" property="gmtModified" />
		<id column="id" property="id" />
		<id column="quota" property="quota" />
		<id column="start_score" property="startScore" />
	</resultMap>
	<sql id="Base_Column_List">
		currency_code, end_score, gmt_create, gmt_modified, id, quota, start_score
	</sql>

    <select id="selectByScore" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM c_credit_score_quota WHERE #{score} BETWEEN start_score AND end_score Limit 1
    </select>
</mapper>