jinpengyong
2020-09-21 f694728af353dcf32e270c0b1b27d81ba76fecd8
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.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>
        and h.json->'$.e12[0]' is not null
        group by h.time
    </select>
</mapper>