| | |
| | | history h,
|
| | | monitorpoint m,
|
| | | equipment e
|
| | | <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>
|
| | | WHERE
|
| | | m.areacode = #{areaCode}
|
| | | AND m.id = e.monitorpoint
|
| | | AND e.mac = h.mac
|
| | | AND h.time > #{start}
|
| | | AND h.time < #{end}
|
| | | <if test="orgIds != null and orgIds.size > 0">
|
| | | <!-- JOIN org_equ oe ON e.id = oe.equid -->
|
| | | AND e.owner_id IN
|
| | | <foreach collection="orgIds" item="listItem" open="(" separator="," close=")" >
|
| | | #{listItem}
|
| | | </foreach>
|
| | | </if>
|
| | | GROUP BY
|
| | | h.mac_key
|
| | | </select>
|
| | |
| | | FROM
|
| | | equipment
|
| | | <if test="orgIds != null and orgIds.size > 0">
|
| | | JOIN org_equ oe ON e.id = oe.equid
|
| | | AND oe.orgid IN
|
| | | <!-- JOIN org_equ oe ON e.id = oe.equid -->
|
| | | where owner_id IN
|
| | | <foreach collection="orgIds" item="listItem" open="(" separator="," close=")" >
|
| | | #{listItem}
|
| | | </foreach>
|