|  |  | 
 |  |  |         h.value->'$.a01008' AS windDir | 
 |  |  |         FROM history_five_minutely_${timeUnits} h , | 
 |  |  |         `device` AS d | 
 |  |  |         WHERE d.mac = h.mac | 
 |  |  |         AND d.mac IN | 
 |  |  |         (SELECT mac FROM device WHERE monitor_point_id IN | 
 |  |  |             <foreach item="monitorPointId" collection="monitorPointIds" index="index" open="(" separator="," close=")"> | 
 |  |  |                 #{monitorPointId} | 
 |  |  |             </foreach> | 
 |  |  |         ) | 
 |  |  |         WHERE d.is_delete = '0' | 
 |  |  |         AND d.mac = h.mac | 
 |  |  |         AND d.monitor_point_id IN | 
 |  |  |         <foreach item="monitorPointId" collection="monitorPointIds" index="index" open="(" separator="," close=")"> | 
 |  |  |             #{monitorPointId} | 
 |  |  |         </foreach> | 
 |  |  |         AND h.time = (SELECT max(time) FROM history_five_minutely_${timeUnits}) | 
 |  |  |         AND d.is_delete = '0' | 
 |  |  |     </select> | 
 |  |  |  | 
 |  |  | </mapper> |