<?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
                    v.code_value AS mortgage_asset_detail,
                    v.code_value_name AS mortgage_asset_detail_n
                FROM
                    sys_code_values_v v
                WHERE
                    v.code                    = 'HLS209_ASSET_DETAIL_IMMOVABLE_PROPERTY_M' AND
                    v.code_enabled_flag       = 'Y' AND
                    v.code_value_enabled_flag = 'Y' AND
                    'IMMOVABLE_PROPERTY_M'    = ${@mortgage_ast_classfication}
                UNION ALL
                SELECT
                    v.code_value AS mortgage_asset_detail,
                    v.code_value_name AS mortgage_asset_detail_n
                FROM
                    sys_code_values_v v
                WHERE
                    v.code                          = 'HLS209_ASSET_DETAIL_MOVABLE_PROPERTY_M' AND
                    v.code_enabled_flag             = 'Y' AND
                    v.code_value_enabled_flag       = 'Y' AND
                    ${@mortgage_ast_classfication} IN ('MOVABLE_PROPERTY_M', 'MOVABLE_PROPERTY_P')
                UNION ALL
                SELECT
                    v.code_value AS mortgage_asset_detail,
                    v.code_value_name AS mortgage_asset_detail_n
                FROM
                    sys_code_values_v v
                WHERE
                    v.code                    = 'HLS209_ASSET_DETAIL_RIGHT_P' AND
                    v.code_enabled_flag       = 'Y' AND
                    v.code_value_enabled_flag = 'Y' AND
                    'RIGHT_P'                 = ${@mortgage_ast_classfication}
            ]]></bm:query-sql>
            <!-- <bm:parameters>
                <bm:parameter name="mortgage_ast_classfication"/>
            </bm:parameters> -->
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="mortgage_asset_detail" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="220" forDisplay="true" forQuery="true" physicalName="MORTGAGE_ASSET_DETAIL" prompt="明细分类代码"/>
        <bm:field name="mortgage_asset_detail_n" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="220" forDisplay="true" forQuery="true" physicalName="MORTGAGE_ASSET_DETAIL_N" prompt="明细分类描述"/>
    </bm:fields>
</bm:model>
