<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: trd
    $Date: 2025年06月10日 10点35分
    $Revision: 1.0
    $Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:fields>
        <bm:field name="bp_id"/>
        <bm:field name="bp_name"/>
        <bm:field name="social_code"/>
        <bm:field name="bp_category"/>
        <bm:field name="bp_name_leg"/>
        <bm:field name="id_card_no_leg"/>
        <bm:field name="bp_name_ag"/>
        <bm:field name="id_card_no_ag"/>
        <bm:field name="agent_phone"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
           select t.bp_id,
                  t.bp_name,
                  t.bp_category,
                  t.social_code,
                  t.bp_name_leg,
                  t.id_card_no_leg,
                  t.bp_name_ag,
                  t.id_card_no_ag,
                  t.agent_phone
             from bp_agent_ele_signer t
                 #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
         <bm:operation name="update">
            <bm:update-sql><![CDATA[
                begin
                    wx_ele_auth_sign_online_pkg.ele_bp_signer_save(
                        p_bp_id =>${@bp_id},
                        p_user_id     =>nvl(${/session/@user_id},1)
                    );
                end;
            ]]></bm:update-sql>
        </bm:operation>
      <bm:operation name="execute">
        <bm:update-sql><![CDATA[
              BEGIN
                UPDATE bp_agent_ele_signer ba
                   SET ba.sign_url            = ${@short_url},
                       ba.last_updated_by      = nvl(${/session/@user_id},1),
                       ba.last_update_date     = sysdate
                 WHERE ba.bp_id = ${@bp_id};
              end;
            ]]></bm:update-sql>
    </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="bp_id" queryExpression="t.bp_id= ${@bp_id}"/>
     </bm:query-fields>
</bm:model>
