<?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
                    t1.*
                FROM
                    (SELECT
                        v.code_value,
                        v.code_value_name,
                        v.code 
                    FROM
                        sys_code_values_v v
                    WHERE
                        v.code in ('CON500_CONTRACT_STATUS') AND
                        v.code_enabled_flag       = 'Y' AND
                        v.code_value_enabled_flag = 'Y'
                    ORDER BY
                        v.order_seq
                    ) t1 #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="code" queryExpression="t1.code =decode(${@lease_channel},&apos;00&apos;,&apos;CON500_CONTRACT_STATUS&apos;,&apos;01&apos;,&apos;CON660_CONTRACT_STATUS&apos;,&apos;CON500_CONTRACT_STATUS&apos;)"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter name="code" expression="t1.code =decode(${@lease_channel},&apos;00&apos;,&apos;CON500_CONTRACT_STATUS&apos;,&apos;01&apos;,&apos;CON660_CONTRACT_STATUS&apos;,&apos;CON500_CONTRACT_STATUS&apos;)"/>
        <bm:data-filter name="code_value" enforceOperations="query" expression="t1.code_value in(&apos;NEW&apos;,&apos;INCEPT&apos;,&apos;ETING&apos;,&apos;REPURING&apos;,&apos;CLOSED&apos;)"/>

    </bm:data-filters>
</bm:model>
