| | |
| | | ORDER BY
|
| | | time
|
| | | </select>
|
| | | |
| | | <select id="getAVGSensorRankByMonitorPointIdList" resultType="java.util.Map">
|
| | | SELECT mp.name, AVG(JSON_EXTRACT(h.value,'$.${sensor}[0]')) sensor
|
| | | FROM device d, history h, monitor_point mp
|
| | | WHERE d.mac=h.mac
|
| | | And mp.id=d.monitor_point_id
|
| | | AND d.monitor_point_id IN
|
| | | <foreach collection="monitorPointIdList" index="index" item="monitorPointId" open="(" separator="," close=")"> |
| | | #{monitorPointId} |
| | | </foreach>
|
| | | AND h.time BETWEEN #{before5Time} AND #{endTime}
|
| | | GROUP BY d.monitor_point_id
|
| | | ORDER BY AVG(JSON_EXTRACT(h.value,'$.${sensor}[0]')) DESC
|
| | | </select>
|
| | |
|
| | | </mapper> |