xufenglei
2017-12-08 7894fc69ea496dbcc024870d002850af71b68f49
src/main/resources/mapper/DeviceMapper.xml
@@ -1,25 +1,6 @@
<?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,
@@ -37,6 +18,7 @@
      </if>
      GROUP BY d.state
   </select>
   <select id="getSensorsByDevice" resultType="map">
      SELECT
         s.`key`,