<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: WangYu  
    $Date: 2015-5-19 下午02:01:15  
    $Revision: 1.0  
    $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 t1.CONTENT_ID,
       t1.CONTRACT_ID,
       t1.CONTENT_NUMBER description,
       t1.templet_id,
       t1.ref_v01,
       (hls_sys_upload_pkg.get_atm_file_href(p_table_pk_value => t1.content_id,
                                             p_source_type    => 'CON_CONTRACT_CONTENT_SIGN',
                                             p_user_id        => 1)) AS file_name,
        cc.lease_item_amount, 
       (select t.tax_type_rate from con_clause_templet t where t.templet_id = t1.templet_id)  tax_type_rate,
       (select tem.tax_type_rate*cc.lease_item_amount from con_clause_templet tem where tem.templet_id = t1.templet_id )  stamp_tax                               
  FROM CON_CONTRACT_CONTENT_V t1,
  con_contract cc
 WHERE t1.contract_id = ${@contract_id}
 and t1.contract_id = cc.contract_id
   AND t1.content_type = 'NORMAL'
  AND T1.content_print_flag = 'Y']]></bm:query-sql>
        </bm:operation>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
               update con_contract_content t set t.ref_v01=${@ref_v01} where t.content_id = ${@content_id}
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
