<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:fields>
        <bm:field name="id" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="code" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" prompt="岗位代码"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" prompt="岗位描述"/>
        <bm:field name="unit_desc" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" prompt="部门"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
				select *
				  From (select a.position_id   as id,
				               a.position_code as code,
				               a.description,
               				   a.company_id,
				               b.UNIT_ID,
				               b.UNIT_CODE,
				               b.description   unit_desc
				          from zj_wfl_position_vl a,
				               exp_org_unit_vl    b
				         where a.unit_id = b.unit_id) v
					 #WHERE_CLAUSE#
					 order by v.id
		   ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:data-filters>
        <!--<bm:data-filter enforceOperations="query" expression=" exists(select 1 from exp_employee_assigns e where e.position_id = v.id)"/>-->
        <bm:data-filter enforceOperations="query" expression="v.company_id = ${/parameter/@company_id}"/>
    </bm:data-filters>
    <bm:query-fields>
        <bm:query-field name="code" queryExpression="v.code like ${@code}"/>
        <bm:query-field name="description" queryExpression="v.description like ${@description}"/>
    </bm:query-fields>
    <!--  <bm:data-filters>
        <bm:data-filter name="company_id" expression="v.company_id = ${/parameter/@company_id}"/>
    </bm:data-filters> -->
</bm:model>