<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: lpc
    $Date: 2018-11-8 下午05:36:49
    $Revision: 1.0
    $Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:fields>
        <bm:field name="agent_name"/>
        <bm:field name="bp_name"/>
        <bm:field name="division_n"/>
        <bm:field name="pattern"/>
        <bm:field name="machine_number"/>
        <bm:field name="lease_execution_date"/>
        <bm:field name="cntrt_no"/>
        <bm:field name="cur_won_bal"/>
        <bm:field name="dly_tot_dd_cnt"/>
        <bm:field name="open_hours"/>
        <bm:field name="address"/>
        <bm:field name="give_back_date"/>
        <bm:field name="system_evaluation_price"/>
        <bm:field name="actual_evaluation_price"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT t1.agent_name,
                t1.bp_name,
                decode(t1.division,
                '01',
                '1',
                '00',
                '2',
                '10',
                '3',
                '03',
                '4',
                ' ') division_n,
                nvl(t1.pattern,
                ' ') pattern,
                nvl(t1.machine_number,
                ' ') machine_number,
                nvl(to_char(t1.lease_execution_date,
                'yyyymmdd'),
                ' ') lease_execution_date,
                t1.cntrt_no,
                nvl(t1.cur_won_bal,
                0) cur_won_bal,
                nvl(t1.dly_tot_dd_cnt,
                0) dly_tot_dd_cnt,
                nvl(t1.open_hours,
                ' ') open_hours,
                nvl(t1.address,
                ' ') address,
                NVL(t1.give_back_date,
                ' ') give_back_date,
                nvl(t1.system_evaluation_price,
                0) system_evaluation_price,
                nvl(t1.actual_evaluation_price,
                0) actual_evaluation_price
                FROM con_trailer_detail_info_lv t1
                WHERE
                t1.con_trailer_id = ${@con_trailer_id}
                ]]></bm:query-sql>
        </bm:operation>
        <bm:operation name="execute">
            <bm:update-sql><![CDATA[
                BEGIN
                hlcm_wx_request_pkg.update_con_usedcar_info(p_con_trailer_id =>${@con_trailer_id}, p_user_id =>${/session/@user_id});
                END;
                ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
