<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="SYS_SMS_LIST" needAccessControl="false">
    <bm:fields>
        <bm:field name="sms_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SMS_ID" prompt="SYS_SMS_LIST.SMS_ID"/>
        <bm:field name="sms_date" databaseType="DATE" datatype="java.util.Date" physicalName="SMS_DATE" prompt="SYS_SMS_LIST.SMS_DATE"/>
        <bm:field name="priority" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PRIORITY" prompt="SYS_SMS_LIST.PRIORITY"/>
        <bm:field name="phone_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PHONE_NUMBER" prompt="SYS_SMS_LIST.PHONE_NUMBER"/>
        <bm:field name="text" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TEXT" prompt="SYS_SMS_LIST.TEXT"/>
        <bm:field name="error_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ERROR_STATUS" prompt="SYS_SMS_LIST.ERROR_STATUS"/>
        <bm:field name="error_msg" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ERROR_MSG" prompt="SYS_SMS_LIST.ERROR_MSG"/>
        <bm:field name="status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="STATUS" prompt="SYS_SMS_LIST.STATUS"/>
        <bm:field name="project_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROJECT_ID" prompt="SYS_SMS_LIST.PROJECT_ID"/>
        <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NUMBER" prompt="SYS_SMS_LIST.CONTRACT_NUMBER"/>
        <bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_NAME" prompt="SYS_SMS_LIST.BP_NAME"/>
        <bm:field name="sms_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SMS_TYPE" prompt="SYS_SMS_LIST.SMS_TYPE"/>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" prompt="SYS_SMS_LIST.CONTRACT_ID"/>
        <bm:field name="batch_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BATCH_ID" prompt="SYS_SMS_LIST.BATCH_ID"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="sms_id"/>
    </bm:primary-key>
    <bm:operations>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
            begin
            hls_payment_msm_send_pkg.after_sys_sms_send_loop(p_sms_id =>${@sms_id},
          										    p_send_result =>${@result},
          											p_user_id =>${/session/@user_id});
          											end;
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:data-filters>
        <bm:data-filter name="query" enforceOperations="query" expression="t1.status = &apos;NEW&apos; and t1.batch_id=${@batch_id}"/>
    </bm:data-filters>
</bm:model>
