| | |
| | | </update>
|
| | | <select id="getMonthAverageBySensor" resultType="map">
|
| | | SELECT
|
| | | AVG(mac_value) monthAverage
|
| | | AVG(mac_value) average
|
| | | FROM
|
| | | history
|
| | | WHERE
|
| | |
| | | GROUP BY
|
| | | mac_key
|
| | | </select>
|
| | |
|
| | | <select id="getEquipmentStates" resultType="map">
|
| | | SELECT
|
| | | COUNT(state) count,
|
| | | state
|
| | | FROM
|
| | | equipment
|
| | | <if test="orgIds != null and orgIds.size > 0">
|
| | | JOIN org_equ oe ON e.id = oe.equid
|
| | | AND oe.orgid IN
|
| | | <foreach collection="orgIds" item="listItem" open="(" separator="," close=")" >
|
| | | #{listItem}
|
| | | </foreach>
|
| | | </if>
|
| | | GROUP BY
|
| | | state
|
| | | </select>
|
| | |
|
| | | <select id="getMacLogByLast" resultType="string">
|
| | | SELECT mac_log FROM logger ORDER BY time DESC LIMIT 1
|
| | | </select>
|
| | | </mapper> |