<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:e="leaf.service.exception" xmlns:db="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="p" baseTable="ZJ_WFL_WORKFLOW_TYPE" defaultOrderBy="workflow_type_id desc">
    <bm:fields>
        <bm:field name="workflow_type_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WORKFLOW_TYPE_ID"/>
        <bm:field name="workflow_type_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="WORKFLOW_TYPE_CODE" prompt="工作流类型代码"/>
        <bm:field name="workflow_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="WORKFLOW_TYPE_DESC" prompt="工作流类型"/>
        <bm:field name="workflow_type" databaseType="VARCHAR2" datatype="java.lang.String" forInsert="false" forUpdate="false" physicalName="WORKFLOW_TYPE_CODE||&apos;-&apos;||WORKFLOW_TYPE_DESC" prompt="类型"/>
        <bm:field name="monthly_checkout_flag" databaseType="VARCHAR2" datatype="java.lang.String"/>
    </bm:fields>
    <bm:features>
        <db:sequence-pk/>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="workflow_type_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="workflow_type_id" queryOperator="="/>
        <bm:query-field field="workflow_type_code" queryOperator="like"/>
        <bm:query-field field="workflow_type_desc" queryOperator="like"/>
    </bm:query-fields>
    <bm:operations>
        <bm:operation name="delete">
            <bm:update-sql><![CDATA[
            begin
				zj_wfl_workflow_pkg.delete_wfl_type
				(
					p_workflow_type_id        => ${@workflow_type_id},					
					p_user_id                 => ${/session/@user_id}
				);
			end;
			]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <e:exception-descriptor-config>
        <e:exception-descriptor exception="java.sql.SQLException" handleClass="leaf.database.SQLExceptionDescriptor">
            <e:error-message code="1" message="类型代码${@workflow_type_code}已经存在!"/>
        </e:exception-descriptor>
    </e:exception-descriptor-config>
</bm:model>
