| | |
| | | <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
|
| | |
| | | GROUP BY
|
| | | time
|
| | | </select>
|
| | | |
| | | <select id="getDayAQIByDevice" resultType="map">
|
| | | SELECT
|
| | | AVG(json -> '$.e1[0]') e1,
|
| | | AVG(json -> '$.e2[0]') e2,
|
| | | AVG(json -> '$.e10[0]') e10,
|
| | | AVG(json -> '$.e11[0]') e11,
|
| | | AVG(json -> '$.e15[0]') e15,
|
| | | AVG(json -> '$.e16[0]') e16
|
| | | FROM
|
| | | data
|
| | | WHERE
|
| | | mac = #{mac}
|
| | | AND time >= #{start}
|
| | | AND time < #{end}
|
| | | </select>
|
| | | |
| | | </mapper> |