<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-8-6 下午6:29:15  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:e="leaf.service.exception" xmlns:o="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="ZJ_WFL_BUSINESS_RULE_ASSIGNS">
    <bm:fields>
        <bm:field name="record_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="RECORD_ID" prompt="ZJ_WFL_BUSINESS_RULE_ASSIGNS.RECORD_ID"/>
        <bm:field name="assign_rule_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ASSIGN_RULE_ID" prompt="ZJ_WFL_BUSINESS_RULE_ASSIGNS.ASSIGN_RULE_ID"/>
        <bm:field name="business_rule_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BUSINESS_RULE_ID" prompt="ZJ_WFL_BUSINESS_RULE_ASSIGNS.BUSINESS_RULE_ID"/>
        <bm:field name="business_rule_code" databaseType="VARCHAR" datatype="java.lang.String" forInsert="false"/>
        <bm:field name="description" databaseType="VARCHAR" datatype="java.lang.String" forInsert="false" forUpdate="false" prompt="权限规则代码"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
    			select t1.record_id,
				       t1.assign_rule_id,
				       t1.business_rule_id,
				       r.business_rule_code,
				       r.description
				  from zj_wfl_business_rule_assigns t1
				 inner join zj_wfl_business_rules_v r
				    on t1.business_rule_id = r.business_rule_id
				 #WHERE_CLAUSE#
    		]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:features>
        <o:sequence-pk/>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="record_id"/>
    </bm:primary-key>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="t1.assign_rule_id = ${@assign_rule_id}"/>
    </bm:data-filters>
    <e:exception-descriptor-config>
        <e:exception-descriptor exception="java.sql.SQLException" handleClass="leaf.database.SQLExceptionDescriptor">
            <e:error-message code="1" message="工作流权限规则代码重复,请重新输入"/>
        </e:exception-descriptor>
    </e:exception-descriptor-config>
</bm:model>
