kaiyu
2020-10-19 a0d0ad8de7ac244aa29d1ca84d13b90e74729e33
1
2
3
4
5
6
7
8
9
10
11
12
<?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="com.moral.mapper.HistoryFiveMinutelyMapper">
    <select id="getFiveMinutesDataByMacsAndTime" resultType="map">
        SELECT h.mac,json->'$.${sensorKey}' as #{sensorKey}
        from history_five_minutely_${yearAndMonth} h
        where time = #{time} and mac IN
        <foreach collection="macs" separator="," open="(" close=")" item="mac">
            #{mac}
        </foreach>
    </select>
</mapper>