<?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="cn.com.ctop.report.mapper.KuaishouAccountReportDailyDwMapper">

    <select id="getReportByParams" resultType="com.alibaba.fastjson.JSONObject">
        SELECT
        stat_date as statDate,
        account_id as accountId,
        account_name as authName,
        ${filedAll}
        FROM
        kuaishou_account_report_daily_dw
        WHERE
        stat_date &lt;= #{endDate}
        AND stat_date &gt;= #{startDate}
        AND account_id in
        <foreach item="item" index="index" collection="accountIds"
                 open="(" separator="," close=")">
            #{item}
        </foreach>
        <if test="hasGroupBy == 1">
            group by ${groupBy}
            order by ${target} ${order}
        </if>
    </select>
</mapper>