<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2015-11-12 下午02:47:51  
    $Revision: 1.0  
    $Purpose: 未办理保险合同
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    c.contract_id,
                    c.contract_number,
                    TO_CHAR(c.inception_of_lease, 'yyyy-mm-dd') inception_of_lease,
                    (SELECT m.bp_name FROM hls_bp_master m WHERE m.bp_id = c.bp_id_tenant
                    ) bp_name
                FROM
                    con_contract c
                WHERE
                    c.contract_status = 'INCEPT' AND
                    c.data_class      = 'NORMAL'
                    --AND yonda_to_do_list_pkg.untransact_insurance_flag(c.contract_id) = 'Y'
                    AND
                    (
                        (
                            ${/session/@company_id} != 1 AND
                            c.spv_company_id         = ${/session/@company_id}
                        )
                        OR
                        (
                            ${/session/@company_id} = 1
                        )
                    )
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
