fengxiang
2018-05-10 1975c595cea467a97bd3ac34571d5051405a12a7
src/main/resources/mapper/DeviceMapper.xml
@@ -15,6 +15,7 @@
    <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" />
   <result column="profession_id" jdbcType="INTEGER" property="professionId" />
     <association property="operateUser" javaType="com.moral.entity.OperateUser">
        <result column="operate_user_id" property="id" jdbcType="INTEGER" />
        <result column="operate_user_name" property="name" jdbcType="VARCHAR" />
@@ -27,6 +28,10 @@
     <association property="monitorPoint" javaType="com.moral.entity.MonitorPoint">
        <result column="monitor_point_id" property="id" jdbcType="INTEGER" />
        <result column="monitor_point_name" property="name" jdbcType="VARCHAR" />
     </association>
     <association property="profession" javaType="com.moral.entity.Profession">
        <result column="profession_id" property="id" jdbcType="INTEGER" />
        <result column="profession_name" property="name" jdbcType="VARCHAR" />
     </association>
  </resultMap>
   <sql id="Example_Where_Clause">
@@ -210,9 +215,13 @@
   </select>
   <select id="selectWithOrgIdsByMac" parameterType="java.lang.String" resultMap="BaseResultWithOrgIdsMap">
      select
      id,device_version_id,mac,monitor_point_id
      from device
      where mac = #{mac,jdbcType=VARCHAR}
      dev.*,
      mpt.name as monitor_point_name,
      pro.name as profession_name
      from device dev
        left join monitor_point  mpt on dev.monitor_point_id = mpt.id
        left join profession  pro on pro.id = dev.profession_id
      where dev.mac = #{mac,jdbcType=VARCHAR}
   </select>
   <select id="getDeviceCountByRegion" resultType="java.lang.Integer">