| | |
| | | FROM
|
| | | history
|
| | | WHERE
|
| | | mac = #{mac}
|
| | | AND mac_key = #{macKey}
|
| | | AND time > #{start}
|
| | | AND time < #{end}
|
| | | mac = #{mac,jdbcType=VARCHAR}
|
| | | AND mac_key = #{macKey,jdbcType=VARCHAR}
|
| | | AND time > #{start,jdbcType=TIMESTAMP}
|
| | | AND time < #{end,jdbcType=TIMESTAMP}
|
| | | </select>
|
| | |
|
| | | <select id="getAverageByAll" resultType="map">
|
| | |
| | | <if test="macKey != null and macKey != 'all'">
|
| | | AND h.mac_key = #{macKey}
|
| | | GROUP BY e.id
|
| | | ORDER BY avg
|
| | | ORDER BY avg desc
|
| | | </if>
|
| | | <if test="macKey == 'all'">
|
| | | GROUP BY h.mac_key
|
| | |
| | | </foreach>
|
| | | </if>
|
| | | GROUP BY state
|
| | | </select>
|
| | |
|
| | | <select id="getMacLogByLast" resultType="string">
|
| | | SELECT mac_log FROM logger ORDER BY time DESC LIMIT 1
|
| | | </select>
|
| | |
|
| | | <select id="getSensorsAverageByEquipment" resultType="map">
|