<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author:   HAND技术
    $Date:     2014/2/21
    $Revision: 1.0
    $Purpose:  招行网银接口数据查询
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
    			select interface_id, 
						company_id, 
						cashflow_id, 
						priority, 
						bp_name, 
						contract_number, 
						times, 
						cf_item,
						cf_item_desc, 
						to_char(due_date, 'yyyy-mm-dd') as due_date, 
						due_amount, 
						funnam, 
						dattyp, 
						lgnnam, 
						buscod, 
						buscod_display, 
						busmod, 
						modals, 
						trstyp, 
						c_trstyp, 
						eptdat, 
						dbtacc, 
						bbknbr, 
						bankarea, 
						sum, 
						total, 
						ccynbr, 
						currency, 
						yurref, 
						memo, 
						accnbr, 
						cltnam, 
						trsamt, 
						bnkflg, 
						eacbnk, 
						eaccty, 
						trsdsp, 
						retcod, 
						retcod_display, 
						errmsg, 
						reqnbr, 
						oprdat, 
						trs_status, 
						trs_status_display, 
						to_char(confirm_date, 'yyyy-mm-dd') as confirm_date, 
						to_char(submit_date, 'yyyy-mm-dd hh24:mi:ss') as submit_date, 
	                    write_off_amount,
						write_off_flag_display, 
						to_char(full_write_off_date, 'yyyy-mm-dd') as full_write_off_date, 
	   					csh_transaction_id,
						csh_transaction_num
				  from HLS_EBANK_INTERFACE_V v
				  #WHERE_CLAUSE#
				 order by v.contract_number, v.times
    		]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:data-filters>
        <bm:data-filter name="query" expression="v.company_id=${/session/@company_id}"/>
    </bm:data-filters>
    <bm:query-fields>
        <bm:query-field name="bp_name" queryExpression="bp_name=${@bp_name}"/>
        <bm:query-field name="dbtacc" queryExpression="dbtacc=${@dbtacc}"/>
        <bm:query-field name="contract_number" queryExpression="contract_number=${@contract_number}"/>
        <bm:query-field name="trs_status" queryExpression="trs_status=${@trs_status}"/>
        <bm:query-field name="due_date" queryExpression="due_date=to_date(${@due_date},&apos;yyyy-mm-dd&apos;)"/>
        <bm:query-field name="cf_item" queryExpression="cf_item=${@cf_item}"/>
    </bm:query-fields>
</bm:model>
