<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: syj $
    $Date: 2018年11月7日15:38:12 $
    $Revision: 1.1 $
    $Purpose: 印花税
-->


<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
    <bm:operation name="query">
        <bm:query-sql><![CDATA[

               SELECT rownum,
                   c.loan_contract_number,
                   to_char(c.signing_date,'yyyy-mm-dd')signing_date,
                   (SELECT m.bp_name FROM hls_bp_master m WHERE m.bp_id = c.loan_con_bp) bp_name,
                   (SELECT b.code_value_name
                      FROM sys_code_values_v b
                     WHERE b.code = 'LOAN_CONTRACT_TERM_TYPE'
                       AND b.code_value = c.loan_contract_term_type) loan_contract_term_type,
                   to_char(c.loan_date_from,'yyyy-mm-dd')loan_date_from,
                   to_char(c.loan_date_to,'yyyy-mm-dd')loan_date_to,
                   c.loan_amount,
                   '0.0003' stamp_duty_rate_1,
                   '0' stamp_duty_1,
                   '0.005%' stamp_duty_rate,
                   c.loan_amount * 0.005 / 100 stamp_duty
              FROM tre_loan_contract c
                where to_char(c.signing_date,'yyyymm') = ${@internal_period_num}
            ]]></bm:query-sql>
    </bm:operation>
</bm:operations>
</bm:model>
