|  |  | 
 |  |  |           AND `time` = #{time} | 
 |  |  |     </select> | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     <select id="selectHourlyListData" parameterType="java.util.List" resultType="java.util.Map"> | 
 |  |  |         SELECT `value`,`time` | 
 |  |  |         FROM history_hourly_${timeUnits} | 
 |  |  |         WHERE mac = #{mac} | 
 |  |  |           AND `time` BETWEEN  #{startTime} and #{endTime} | 
 |  |  |     </select> | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     <select id="selectDataByMacsAndTime" parameterType="java.util.List" resultType="java.util.Map"> | 
 |  |  |         select mac, `time`, `value` from history_hourly_${timeUnits} | 
 |  |  |         where mac in | 
 |  |  | 
 |  |  |         where mac = #{mac} | 
 |  |  |           and time =#{time} | 
 |  |  |     </select> | 
 |  |  |  | 
 |  |  |     <insert id="insertHistoryHourly"> | 
 |  |  |         INSERT INTO history_hourly_${timeUnits} | 
 |  |  |         VALUES (#{mac}, #{time}, #{value}, #{version}) | 
 |  |  |     </insert> | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     <insert id="updateHistoryHourly"> | 
 |  |  |         UPDATE history_hourly_${timeUnits} SET `value` = #{value} | 
 |  |  |         where mac =  #{mac} and time = #{time} and version = #{version} | 
 |  |  |     </insert> | 
 |  |  | </mapper> |