<?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="${packageName}.mapper.block.${InstanceClassName}Mapper">

    <select id="selectData" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
        select
#if(!$chartQuery.metricOnly)
            ${chartQuery.dimensionSql} as dimensionKey,
#end
            ${chartQuery.metricSelectSql}
        from ${chartQuery.tableName} t
#if($chartQuery.whereSql)
        where ${chartQuery.whereSql}
#end
#if($chartQuery.groupBySql)
        group by ${chartQuery.groupBySql}
#end
#if($chartQuery.orderBySql)
        order by ${chartQuery.orderBySql}
#end
        limit ${chartQuery.limit}
    </select>
</mapper>
