contract_insurance_temp.lwm 4.08 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1
<?xml version="1.0" encoding="UTF-8"?>
stone's avatar
stone committed
2
<bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="CONTRACT_INSURANCE_TEMP" needAccessControl="false">
Spencer Chang's avatar
Spencer Chang committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
    <bm:fields>
        <bm:field name="record_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="RECORD_ID" prompt="CONTRACT_INSURANCE_TEMP.RECORD_ID"/>
        <bm:field name="batch_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BATCH_ID" prompt="CONTRACT_INSURANCE_TEMP.BATCH_ID"/>
        <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NUMBER" prompt="CONTRACT_INSURANCE_TEMP.CONTRACT_NUMBER"/>
        <bm:field name="insurance_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INSURANCE_NUMBER" prompt="CONTRACT_INSURANCE_TEMP.INSURANCE_NUMBER"/>
        <bm:field name="pattern" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="pattern" prompt="CONTRACT_INSURANCE_TEMP.pattern"/>
        <bm:field name="model_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MODEL_NUMBER" prompt="CONTRACT_INSURANCE_TEMP.MODEL_NUMBER"/>
        <bm:field name="engine_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENGINE_NUMBER" prompt="CONTRACT_INSURANCE_TEMP.ENGINE_NUMBER"/>
        <bm:field name="real_insurance_date"  prompt="CONTRACT_INSURANCE_TEMP.REAL_INSURANCE_DATE"/>
        <bm:field name="insurance_end_date"  prompt="CONTRACT_INSURANCE_TEMP.INSURANCE_END_DATE"/>
        <bm:field name="ins_company"  />
        <bm:field name="err_message" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ERR_MESSAGE" prompt="CONTRACT_INSURANCE_TEMP.ERR_MESSAGE"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="record_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field name="batch_id" queryExpression="t1.batch_id=${@batch_id}"/>
    </bm:query-fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
               Select t1.record_id,
               t1.batch_id,
               t1.contract_number,
               t1.insurance_number,
               t1.pattern,
               t1.model_number,
               t1.engine_number,
               to_char(t1.real_insurance_date,'yyyy-mm-dd') real_insurance_date,
               to_char(t1.insurance_end_date ,'yyyy-mm-dd') insurance_end_date,
               t1.ins_company,
               t1.err_message
          From CONTRACT_INSURANCE_TEMP t1
          Where t1.batch_id =${@batch_id}
         Order By decode(t1.err_message, Null, 2, 1),contract_number asc
         ]]></bm:query-sql>
        </bm:operation>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
            begin
             contract_insurance_pkg.save_data
                    (
                        p_batch_id=>${@batch_id},
                        p_user_id=>${/session/@user_id},
                        p_company_id =>${/session/@company_id}
                    );
             end;
         ]]></bm:update-sql>
        </bm:operation>
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
        <bm:operation name="insert">
            <bm:update-sql><![CDATA[
            begin
             contract_insurance_pkg.save_insurance_data(
                                p_contract_id         =>${@contract_id},
                                p_insurance_number    =>${@insurance_number},
                                p_insurance_fee       =>${@insurance_fee},
                                p_insurance_rate      =>${@insurance_rate},
                                p_real_insurance_date =>to_date(${@real_insurance_date},'yyyy-mm-dd'),
                                p_insurance_end_date  =>to_date(${@insurance_end_date},'yyyy-mm-dd'),
                                p_ins_company         =>${@ins_company},
                                p_user_id             =>${/session/@user_id}
                                );
             end;
         ]]></bm:update-sql>
        </bm:operation>
Spencer Chang's avatar
Spencer Chang committed
72 73
    </bm:operations>
</bm:model>