<?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.ArchievementMapper">
    <select id="getDepartmentArchievement" useCache="false" flushCache="true" statementType="CALLABLE" parameterType="java.util.HashMap"> 
        call telsale_archievement_pkg.department_archievement(
            #{a_department_code, mode=IN, jdbcType=VARCHAR},
            #{a_attaching_rate, mode=OUT, jdbcType=VARCHAR},
            #{a_attaching_rate_target, mode=OUT, jdbcType=VARCHAR},
            #{a_renewal_rate, mode=OUT, jdbcType=VARCHAR},
            #{a_renewal_rate_target, mode=OUT, jdbcType=VARCHAR},
            #{a_total, mode=OUT, jdbcType=INTEGER, javaType=Integer},
            #{a_mensual_cur, mode=OUT, jdbcType=CURSOR, resultMap=MensualArchievementMapper})
    </select>
    <select id="getCallerArchievement" useCache="false" flushCache="true" statementType="CALLABLE" parameterType="java.util.HashMap">
        call telsale_archievement_pkg.caller_archievement(
            #{a_caller_code, mode=IN, jdbcType=VARCHAR},
            #{a_attaching_rate, mode=OUT, jdbcType=VARCHAR},
            #{a_renewal_rate, mode=OUT, jdbcType=VARCHAR},
            #{a_total, mode=OUT, jdbcType=INTEGER, javaType=Integer},
            #{a_present_month, mode=OUT, jdbcType=DOUBLE, javaType=Double},
            #{a_mensual_cur, mode=OUT, jdbcType=CURSOR, resultMap=MensualArchievementMapper})
    </select>

    <resultMap id="MensualArchievementMapper" type="MensualArchievementItem">
        <id property="month" column="mm" javaType="INT"/>
        <result property="premium" column="bf" />
    </resultMap>
</mapper>