<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: liukang
    $Date: 2016年4月06日 上午11:41:34  
    $Revision: 1.0  
    $Purpose: 品牌lov
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    *
                FROM
                    (SELECT
                        t.brand_id,
                        t.brand_code,
                        t.description,
                        DECODE(
                        (SELECT
                            COUNT(*) FROM HLS_PRODUCT_TO_GRANT_BRAND a WHERE a.product_grant_id = ${/parameter/@product_grant_id} AND
                            a.brand_id                                                          = t.brand_id
                        ),0, 'N','Y')enable_flag
                    FROM
                        hls_car_brands_vl t
                    WHERE
                        t.enabled_flag = 'Y'
                    ) t1 #WHERE_CLAUSE#
                ORDER BY
                    brand_code
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="brand_code" queryExpression="t1.brand_code like ${@brand_code}"/>
        <bm:query-field name="description" queryExpression="t1.description like ${@description}"/>
    </bm:query-fields>
</bm:model>
