<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper  PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cpic.xim.mybatis.mapper.RankingListMapper">
    <select id="getRankingList" flushCache="true" statementType="CALLABLE" parameterType="java.util.HashMap">
        call telsale_archievement_pkg.caller_arch_ranking_list(
            #{a_department_code,mode=IN,jdbcType=VARCHAR},
            #{a_year,mode=IN,jdbcType=VARCHAR},
            #{a_month,mode=IN,jdbcType=VARCHAR},
            #{a_attaching_ranking_list,mode=OUT,jdbcType=CURSOR, resultMap=AttachingRateRankingMap},
            #{a_renewal_ranking_list,mode=OUT,jdbcType=CURSOR, resultMap=RenewalRateRankingMap})
    </select>
    <resultMap id="AttachingRateRankingMap" type="CallerRankingItem">
        <id property="index" column="rownum" jdbcType="INTEGER" javaType="int"/>
        <result property="callerName" column="caller_name" jdbcType="VARCHAR" javaType="String"/>
        <result property="appraiseValue" column="attaching_rate" jdbcType="VARCHAR" javaType="String"/>
    </resultMap>
    <resultMap id="RenewalRateRankingMap" type="CallerRankingItem">
        <id property="index" column="rownum" jdbcType="INTEGER" javaType="int"/>
        <result property="callerName" column="caller_name" jdbcType="VARCHAR" javaType="String"/>
        <result property="appraiseValue" column="renewal_rate" jdbcType="VARCHAR" javaType="String"/>
    </resultMap>
</mapper>