<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Administrator  
    $Date: 2015-5-28 下午2:19:08  
    $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
                    *
                FROM
                    (SELECT
                        t.contract_id,
                        t.contract_name,
                        u.description AS unit_name,
                        e.employee_name,
                        to_char(t.last_update_date,'yyyy/mm/dd') AS submit_date
                    FROM
                        con_contract t,
                        exp_employee_assigns t1,
                        exp_emp_user_e_v e,
                        fnd_companies_vl c,
                        exp_org_position_vl p,
                        exp_org_unit_vl u
                    WHERE
                        t1.enabled_flag          = 'Y' AND
                        e.employee_id            = t1.employee_id AND
                        c.company_id             = t1.company_id AND
                        c.enabled_flag           = 'Y' AND
                        p.position_id            = t1.position_id AND
                        p.enabled_flag           = 'Y' AND
                        u.unit_id                = p.unit_id AND
                        u.enabled_flag           = 'Y' AND
                        e.company_id             = t1.company_id AND
                        u.COMPANY_ID             = t1.company_id AND
                        t1.primary_position_flag = 'Y' AND
                        e.position_id            = t1.position_id AND
                        t.employee_id            = t1.employee_id
                    ) t1 #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="contract_id" queryExpression="t1.contract_id=${@contract_id}"/>
    </bm:query-fields>
</bm:model>
