| | |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.moral.mapper.DeviceMapper"> |
| | | <resultMap id="BaseResultMap" type="com.moral.entity.Device"> |
| | | <!-- |
| | | WARNING - @mbggenerated |
| | | This element is automatically generated by MyBatis Generator, do not modify. |
| | | This element was generated on Wed Nov 29 16:17:59 CST 2017. |
| | | --> |
| | | <id column="id" jdbcType="INTEGER" property="id" /> |
| | | <result column="name" jdbcType="VARCHAR" property="name" /> |
| | | <result column="address" jdbcType="VARCHAR" property="address" /> |
| | | <result column="longitude" jdbcType="REAL" property="longitude" /> |
| | | <result column="latitude" jdbcType="REAL" property="latitude" /> |
| | | <result column="mac" jdbcType="VARCHAR" property="mac" /> |
| | | <result column="operate_user_id" jdbcType="INTEGER" property="operateUserId" /> |
| | | <result column="state" jdbcType="CHAR" property="state" /> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
| | | <result column="install_time" jdbcType="TIMESTAMP" property="installTime" /> |
| | | <result column="monitor_point_id" jdbcType="INTEGER" property="monitorPointId" /> |
| | | <result column="device_version_id" jdbcType="INTEGER" property="deviceVersionId" /> |
| | | </resultMap> |
| | | <select id="getDeviceStatesByAccount" resultType="map"> |
| | | SELECT |
| | | COUNT( d.state ) count, |
| | |
| | | WHERE |
| | | d.monitor_point_id = mp.id |
| | | AND mp.organization_id IN |
| | | <foreach close=")" collection="orgIds" item="listItem" open="(" separator=","> |
| | | <foreach collection="orgIds" open="(" separator="," close=")" item="listItem"> |
| | | #{listItem} |
| | | </foreach> |
| | | </if> |
| | | GROUP BY d.state |
| | | </select> |
| | |
|
| | | <select id="getSensorsByDevice" resultType="map"> |
| | | SELECT |
| | | s.`key`, |