<?xml version="1.0" encoding="UTF-8"?> <!-- $Author: qm $Date: 2014-4-21 上午9:52:31 $Revision: 1.0 $Purpose: --> <bm:model xmlns:o="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="AST_CAR_LICENSE"> <bm:fields> <bm:field name="ast_car_license_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="AST_CAR_LICENSE_ID" prompt="AST_CAR_LICENSE.AST_CAR_LICENSE_ID"/> <bm:field name="item_detail_id" databaseType="NUMBER" datatype="java.lang.Long" insertExpression="${/parameter/@item_detail_id}" physicalName="ITEM_DETAIL_ID" prompt="AST_CAR_LICENSE.ITEM_DETAIL_ID"/> <bm:field name="license_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LICENSE_NUMBER" prompt="AST_CAR_LICENSE.LICENSE_NUMBER" required="true"/> <bm:field name="on_car_date" databaseType="DATE" datatype="java.util.Date" physicalName="ON_CAR_DATE" prompt="AST_CAR_LICENSE.ON_CAR_DATE" required="true"/> <bm:field name="license_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LICENSE_FEE" prompt="AST_CAR_LICENSE.LICENSE_FEE"/> <bm:field name="license_attach_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LICENSE_ATTACH_FEE" prompt="AST_CAR_LICENSE.LICENSE_ATTACH_FEE"/> <bm:field name="shh_license_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SHH_LICENSE_FLAG" prompt="AST_CAR_LICENSE.SHH_LICENSE_FLAG"/> <bm:field name="purchase_date" databaseType="DATE" datatype="java.util.Date" physicalName="PURCHASE_DATE"/> <bm:field name="purchase_price" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PURCHASE_PRICE"/> <bm:field name="license_end_date" databaseType="DATE" datatype="java.util.Date" physicalName="LICENSE_END_DATE"/> <bm:field name="mortgage_date" databaseType="DATE" datatype="java.util.Date" physicalName="MORTGAGE_DATE"/> <bm:field name="enabled_flag"/> </bm:fields> <bm:operations> <bm:operation name="insert"> <bm:update-sql><![CDATA[ begin insert into ast_car_license( ast_car_license_id, item_detail_id, license_number, on_car_date, license_fee, license_attach_fee, shh_license_flag, enabled_flag, purchase_date, purchase_price, license_end_date, mortgage_date, created_by,creation_date,last_update_date,last_updated_by )values( ast_car_license_s.nextval, ${/parameter/@item_detail_id}, ${@license_number}, to_date(${@on_car_date},'yyyy-mm-dd'), ${@license_fee}, ${@license_attach_fee}, ${@shh_license_flag}, ${@enabled_flag}, to_date(${@purchase_date},'yyyy-mm-dd'), ${@purchase_price}, to_date(${@license_end_date},'yyyy-mm-dd'), to_date(${@mortgage_date},'yyyy-mm-dd'), ${/session/@user_id},sysdate,sysdate,${/session/@user_id} ); ast_car_pkg.check_license_enable(p_item_detail_id => ${/parameter/@item_detail_id}, p_user_id => ${/session/@user_id}); end; ]]></bm:update-sql> </bm:operation> <bm:operation name="update"> <bm:update-sql><![CDATA[ begin UPDATE AST_CAR_LICENSE t1 SET t1.ITEM_DETAIL_ID = ${@item_detail_id}, t1.LICENSE_NUMBER = ${@license_number}, t1.ON_CAR_DATE = to_date(${@on_car_date},'yyyy-mm-dd'), t1.LICENSE_FEE = ${@license_fee}, t1.LICENSE_ATTACH_FEE = ${@license_attach_fee}, t1.enabled_flag = ${@enabled_flag}, t1.SHH_LICENSE_FLAG = ${@shh_license_flag}, t1.PURCHASE_DATE = to_date(${@purchase_date},'yyyy-mm-dd'), t1.PURCHASE_PRICE = ${@purchase_price}, t1.LICENSE_END_DATE = to_date(${@license_end_date},'yyyy-mm-dd'), t1.mortgage_date = to_date(${@mortgage_date},'yyyy-mm-dd'), t1.LAST_UPDATED_BY = ${/session/@user_id}, t1.LAST_UPDATE_DATE = sysdate WHERE t1.AST_CAR_LICENSE_ID = ${@ast_car_license_id}; ast_car_pkg.check_license_enable(p_item_detail_id => ${@item_detail_id}, p_user_id => ${/session/@user_id}); end; ]]></bm:update-sql> </bm:operation> </bm:operations> <bm:features> <f:standard-who/> <o:sequence-pk sequenceName="ast_car_license_s"/> </bm:features> <bm:primary-key> <bm:pk-field name="ast_car_license_id"/> </bm:primary-key> <bm:query-fields> <bm:query-field field="item_detail_id" queryOperator="="/> </bm:query-fields> </bm:model>