xufenglei
2018-11-21 a4c1346fe8b37507d69413632848d30a5826efc6
src/main/resources/mapper/DeviceMapper.xml
@@ -362,4 +362,26 @@
         AND mp.is_delete = 0 
         AND mp.organization_id = #{organizationId}
   </select>
   <select id="getDevicesStateByRegion" resultType="map">
      SELECT
         d.id deviceId,d.mac,d.state,d.name deviceName,
         mp.id,mp.name
      FROM
         device d ,
         monitor_point mp
      <where>
         d.monitor_point_id = mp.id
         AND d.is_delete = 0
         AND mp.is_delete = 0
         AND mp.${regionType}_code = #{regionCode}
      <if test="orgIds != null and orgIds.size &gt; 0">
         AND mp.organization_id IN
         <foreach  collection="orgIds" open="(" separator="," close=")" item="listItem">
            #{listItem}
         </foreach>
      </if>
      </where>
   </select>
</mapper>