<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Foreinyel  
    $Date: 2014-7-18 下午1:32:09  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:o="leaf.database.local.oracle" xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="HLS_EBANK_BOC_ENTRUSTS">
    <bm:fields>
        <bm:field name="entrust_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ENTRUST_ID" prompt="HLS_EBANK_BOC_ENTRUSTS.ENTRUST_ID"/>
        <bm:field name="serial_no" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SERIAL_NO" prompt="HLS_EBANK_BOC_ENTRUSTS.SERIAL_NO"/>
        <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NUMBER" prompt="HLS_EBANK_BOC_ENTRUSTS.CONTRACT_NUMBER"/>
        <bm:field name="bank_account" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BANK_ACCOUNT" prompt="HLS_EBANK_BOC_ENTRUSTS.BANK_ACCOUNT"/>
        <bm:field name="bank_account_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BANK_ACCOUNT_NAME" prompt="HLS_EBANK_BOC_ENTRUSTS.BANK_ACCOUNT_NAME"/>
        <bm:field name="id_card_no" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ID_CARD_NO" prompt="HLS_EBANK_BOC_ENTRUSTS.ID_CARD_NO"/>
        <bm:field name="export_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPORT_FLAG" prompt="HLS_EBANK_BOC_ENTRUSTS.EXPORT_FLAG"/>
        <bm:field name="return_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="RETURN_CODE" prompt="HLS_EBANK_BOC_ENTRUSTS.RETURN_CODE"/>
        <bm:field name="return_msg" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="RETURN_MSG" prompt="HLS_EBANK_BOC_ENTRUSTS.RETURN_MSG"/>
        <bm:field name="export_flag_disp" expression="(select code_value_name from sys_code_values_v p where p.code = &apos;HLS_EBANK_BOC_EMPORT_FLAG&apos; and p.code_value = t1.export_flag)" forInsert="false" forUpdate="false"/>
        <bm:field name="bank_type" expression="(select cc.withhold_way from con_contract cc where cc.data_class=&apos;NORMAL&apos; and cc.contract_number = t1.contract_number) "/>
        <bm:field name="contract_status" expression="(select cc.contract_status from con_contract cc where cc.contract_number = t1.contract_number and cc.data_class=&apos;NORMAL&apos;)"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk/>
    </bm:features>
    <bm:query-fields>
        <bm:query-field field="contract_number" queryOperator="="/>
        <bm:query-field field="contract_status" queryExpression="(select cc.contract_status from con_contract cc where cc.contract_number = t1.contract_number and cc.data_class=&apos;NORMAL&apos;) = ${@contract_status}"/>
        <bm:query-field field="bank_account" queryOperator="="/>
        <bm:query-field name="customer_name" queryExpression="t1.bank_account_name = ${@customer_name}"/>
        <bm:query-field field="export_flag" queryOperator="="/>
        <bm:query-field name="bank_type" queryExpression="exists (select 1 from con_contract cc where cc.contract_number = t1.contract_number and cc.data_class=&apos;NORMAL&apos; and cc.withhold_way=${@bank_type})"/>
    </bm:query-fields>
    <bm:primary-key>
        <bm:pk-field name="entrust_id"/>
    </bm:primary-key>
</bm:model>
