<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
        select decode(v.con_num,0,'N','Y') statusFlag from (
       select count(1) con_num from con_contract cc
       where cc.data_class = 'NORMAL'
       and cc.sign_type = 'ELE_SIGN'
       and cc.sign_contract_status = 'SIGNING'
       and cc.ec_sign_type in ('INITIATE', 'SIGNING')
       and cc.contract_id in (
        select distinct t.contract_id  from CON_CONTRACT_ELE_SIGNER t
        where t.bp_name = ${@bp_name}
        and t.id_no = ${@id_no}
        and t.id_type = 'IdCard')) v
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="statusFlag"/>
    </bm:fields>
</bm:model>
