jinpengyong
2020-10-09 c60311f48e7ec07c56a4df31536f795ba62751ce
src/main/resources/mapper/HistoryHourlyMapper.xml
@@ -63,4 +63,21 @@
        </foreach>
    </insert>
    <select id="getBeamByMacs" resultType="java.util.Map">
        SELECT
        DATE_FORMAT(h.time,#{typeFormat}) time,
        avg(h.json->'$.e12[0]') 'beam'
        FROM history_hourly h
        WHERE h.json->'$.e12[0]' is not null
        and h.mac in
        <foreach collection="macs" open="(" separator="," close=")" item="mac">
            #{mac}
        </foreach>
        and h.time in
        <foreach collection="times" open="(" separator="," close=")" item="time">
            #{time}
        </foreach>
        group by h.time
    </select>
</mapper>