| | |
| | | </select>
|
| | |
|
| | | <select id="getAverageByAll" resultType="map">
|
| | | <!-- |
| | | SELECT
|
| | | h.mac_key,
|
| | | AVG(h.mac_value) avg
|
| | |
| | | AND h.time < #{end}
|
| | | GROUP BY
|
| | | h.mac_key
|
| | | -->
|
| | |
|
| | | SELECT
|
| | | mac_key,
|
| | | AVG(mac_value) avg
|
| | | FROM
|
| | | history h
|
| | | <if test="orgIds!=null and orgIds.size > 0">
|
| | | JOIN (
|
| | | SELECT
|
| | | e.mac
|
| | | FROM
|
| | | equipment e,
|
| | | org_equ oe
|
| | | WHERE
|
| | | e.id = oe.equid
|
| | | AND oe.orgid IN
|
| | | <foreach collection="orgIds" item="listItem" open="(" separator="," close=")" >
|
| | | #{listItem}
|
| | | </foreach>
|
| | | ) e ON h.mac = e.mac
|
| | | </if>
|
| | | WHERE h.time > #{start}
|
| | | AND h.time < #{end}
|
| | | GROUP BY
|
| | | mac_key
|
| | | </select>
|
| | |
|
| | | <select id="getEquipmentStates" resultType="map">
|