<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                select * from (SELECT
                    a.creation_date,
                    a.file_name,
                    a.batch_status,
                    a.created_by,
                    a.batch_id
                FROM
                    csh_trx_batch_interface a
                WHERE
                    a.company_id  = ${/session/@company_id} AND
                    a.batch_class = 'TTT' 
                ORDER BY
                    a.creation_date DESC) tt #WHERE_CLAUSE# 
            ]]></bm:query-sql>
            <bm:parameters>
                <bm:parameter inputPath="/session/@company_id"/>
            </bm:parameters>
        </bm:operation>
        <bm:operation name="delete">
            <bm:update-sql><![CDATA[
    		
    			begin
                    CUS_CSH_EBANK_TRX_PKG.UPLOAD_WRITE_OFF_DELETE
                    (
                        p_batch_id=>${@batch_id},
                        p_user_id=>${/session/@user_id}
                    );
                end;
    		
    		]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
    			
    				begin
                    CUS_CSH_EBANK_TRX_PKG.UPLOAD_WRITE_OFF_CONFIRM
                    (
                        p_batch_id=>${@batch_id},
                        p_user_id=>${/session/@user_id}
                    );
                end;
    			
    		]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="creation_date" databaseType="DATE" datatype="java.util.Date" physicalName="CREATION_DATE"/>
        <bm:field name="file_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_NAME"/>
        <bm:field name="batch_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BATCH_STATUS"/>
        <bm:field name="created_by" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CREATED_BY"/>
        <bm:field name="batch_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BATCH_ID"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field name="batch_status" queryExpression="tt.batch_status =${@batch_status}"/>
    </bm:query-fields>
</bm:model>
