<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: qwm 
    $Date: 2013-8-26 上午10:34:46  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="PRJ_PROJECT_MORTGAGE" defaultOrderBy="decode(${@default_contract_seq},contract_seq,&apos;Y&apos;,&apos;N&apos;) desc,contract_seq">
    <bm:fields>
        <bm:field name="prj_mortgage_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PRJ_MORTGAGE_ID" prompt="PRJ_PROJECT_MORTGAGE.PRJ_MORTGAGE_ID"/>
        <bm:field name="project_id" databaseType="NUMBER" datatype="java.lang.Long" forUpdate="false" physicalName="PROJECT_ID" prompt="PRJ_PROJECT_MORTGAGE.PROJECT_ID"/>
        <bm:field name="mortgage_id" databaseType="NUMBER" datatype="java.lang.Long" forUpdate="false" physicalName="MORTGAGE_ID" prompt="PRJ_PROJECT_MORTGAGE.MORTGAGE_ID"/>
        <bm:field name="mortgage_code" databaseType="VARCHAR2" datatype="java.lang.String" forUpdate="false" physicalName="MORTGAGE_CODE" prompt="PRJ_PROJECT_MORTGAGE.MORTGAGE_CODE"/>
        <bm:field name="mortgage_name" databaseType="VARCHAR2" datatype="java.lang.String" forUpdate="false" physicalName="MORTGAGE_NAME" prompt="PRJ_PROJECT_MORTGAGE.MORTGAGE_NAME"/>
        <bm:field name="contract_seq" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_SEQ" prompt="PRJ_PROJECT_MORTGAGE.CONTRACT_SEQ" updateExpression="${../@contract_seq}"/>
        <bm:field name="check_flag" expression="decode(${@default_contract_seq},contract_seq,&apos;Y&apos;,&apos;N&apos;)" forInsert="false" forUpdate="false"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="prj_mortgage_id"/>
    </bm:primary-key>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="t1.project_id=${@project_id}"/>
        <bm:data-filter enforceOperations="update" expression="${@check_flag}=&apos;Y&apos;"/>
    </bm:data-filters>
</bm:model>
