<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.demo.mapper.BrandBusinessDao">
    <select id="selectByStatistics" resultType="com.ruoyi.demo.entity.BrandBusiness">
        SELECT
            brand_id,
            brand_name,
            business_status,
            COUNT(*) count
        FROM
            `ddt_store_wd`
        WHERE brand_id <![CDATA[<>]]> ''
        AND brand_id IS NOT NULL
        <if test="ins != null">
            <foreach collection="ins" item="in" open="AND brand_id IN (" separator="," close=")">
                #{in,jdbcType=VARCHAR}
            </foreach>
        </if>
        GROUP BY
            brand_id,
            brand_name,
            business_status;
    </select>
    <select id="selectIns" resultType="java.lang.String">
        SELECT DISTINCT
            brand_id
        FROM
            `bl_brand_business_statistics`
    </select>
</mapper>
