kaiyu
2020-12-14 9f1cce696af7a385d7673853f517261da91af111
src/main/resources/mapper/HistoryFiveMinutelyMapper.xml
@@ -20,4 +20,16 @@
        where  h.time = #{time}
        and h.mac = #{mac}
    </select>
    <select id="getFiveMinutesSersorDataByMacsAndTime" resultType="map">
        SELECT h.mac,h.time,
        <foreach collection="sensorKeys" separator="," item="sensorKey">
            json->'$.${sensorKey}' AS '${sensorKey}'
        </foreach>
        from history_five_minutely_${yearAndMonth} h
        where time = #{time} and mac IN
        <foreach collection="macs" separator="," open="(" close=")" item="mac">
            #{mac}
        </foreach>
    </select>
</mapper>