<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hand  
    $Date: 2016-4-25 下午5:20:00  
    $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="CON_EXPRESS_HD">
    <bm:fields>
        <bm:field name="express_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EXPRESS_ID" prompt="CON_EXPRESS_HD.EXPRESS_ID"/>
        <bm:field name="express_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPRESS_NUMBER" prompt="CON_EXPRESS_HD.EXPRESS_NUMBER"/>
        <bm:field name="express_company" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPRESS_COMPANY" prompt="CON_EXPRESS_HD.EXPRESS_COMPANY"/>
        <bm:field name="express_province" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPRESS_PROVINCE" prompt="CON_EXPRESS_HD.EXPRESS_PROVINCE"/>
        <bm:field name="express_city" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPRESS_CITY" prompt="CON_EXPRESS_HD.EXPRESS_CITY"/>
        <bm:field name="express_address" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPRESS_ADDRESS" prompt="CON_EXPRESS_HD.EXPRESS_ADDRESS"/>
        <bm:field name="express_date" databaseType="DATE" datatype="java.util.Date" physicalName="EXPRESS_DATE" prompt="CON_EXPRESS_HD.EXPRESS_DATE"/>
        <bm:field name="express_person" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPRESS_PERSON" prompt="CON_EXPRESS_HD.EXPRESS_PERSON"/>
        <bm:field name="express_tel" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPRESS_TEL" prompt="CON_EXPRESS_HD.EXPRESS_TEL"/>
        <bm:field name="express_note" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPRESS_NOTE" prompt="CON_EXPRESS_HD.EXPRESS_NOTE"/>
        <bm:field name="express_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPRESS_TYPE" prompt="CON_EXPRESS_HD.EXPRESS_TYPE"/>
        <bm:field name="recipient" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="RECIPIENT" prompt="CON_EXPRESS_HD.RECIPIENT"/>
        <bm:field name="recipient_tel" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="RECIPIENT_TEL" prompt="CON_EXPRESS_HD.RECIPIENT_TEL"/>
        <bm:field name="invoice_agent" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_AGENT" prompt="CON_EXPRESS_HD.INVOICE_AGENT"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="express_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field name="express_number" queryExpression="t1.express_number like upper(&apos;%&apos;||${@express_number}||&apos;%&apos;)"/>
        <bm:query-field name="express_date" queryExpression="t1.express_date=to_date(${@express_date},&apos;yyyy-mm-dd&apos;)"/>
        <bm:query-field name="contract_number" queryExpression="t1.express_id in( select cel.express_id   from CON_EXPRESS_LN cel   where cel.contract_id in   (select c.contract_id  from con_contract c  where c.contract_number like upper(&apos;%&apos;||${@contract_number}||&apos;%&apos;)))"/>
        <bm:query-field name="reg_status" queryExpression="t1.express_id in( select cel.express_id   from CON_EXPRESS_LN cel   where cel.contract_id in   (select c.contract_id  from con_contract c  where c.ARCHIVE_STATUS=${@reg_status}))"/>
        <bm:query-field name="archive_status" queryExpression="t1.express_id in( select cel.express_id   from CON_EXPRESS_LN cel   where cel.contract_id in   (select c.contract_id  from con_contract c  where c.ARCHIVE_STATUS=${@archive_status}))"/>
        <!--  <bm:query-field name="borrow_date_from" queryExpression="t1.borrower_date &gt;= to_date(${@borrow_date_from},&apos;yyyy-mm-dd&apos;) "/>
        <bm:query-field name="borrow_date_to" queryExpression="t1.borrower_date &lt;= to_date(${@borrow_date_to},&apos;yyyy-mm-dd&apos;)"/> -->
    </bm:query-fields>
</bm:model>
