<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: mumu  
    $Date: 2014-7-25 上午12:58:56  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    t.*,
                    DECODE(t.packet_number, 1, '主车', '挂车') car_type,
                    TO_CHAR(t.insurance_start_date, 'yyyy-mm-dd') insurance_start_date_n,
                    (SELECT m1.bp_name FROM hls_bp_master m1 WHERE m1.bp_id = t.main_ins_company
                    ) main_ins_company_n,
                    (SELECT m2.bp_name FROM hls_bp_master m2 WHERE m2.bp_id = t.slave_ins_company
                    ) slave_ins_company_n,
                    t.ref_v03,
                    t.engine
                FROM
                    prj_project_lease_item t
                WHERE
                    t.project_id   = ${@project_id} AND
                    t.packet_number= ${@packet_number}
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
