From 5f549c4d7bb36ff4dc012fed9ee1e049dbf899a8 Mon Sep 17 00:00:00 2001
From: fengxiang <110431245@qq.com>
Date: Tue, 08 May 2018 09:28:55 +0800
Subject: [PATCH] 运维app getEquInfoByMac api
---
src/main/resources/mapper/DeviceMapper.xml | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/src/main/resources/mapper/DeviceMapper.xml b/src/main/resources/mapper/DeviceMapper.xml
index f9f17da..36ce410 100644
--- a/src/main/resources/mapper/DeviceMapper.xml
+++ b/src/main/resources/mapper/DeviceMapper.xml
@@ -16,17 +16,17 @@
<result column="monitor_point_id" jdbcType="INTEGER" property="monitorPointId" />
<result column="device_version_id" jdbcType="INTEGER" property="deviceVersionId" />
<association property="operateUser" javaType="com.moral.entity.OperateUser">
- <result column="id" property="id" jdbcType="INTEGER" />
- <result column="name" property="name" jdbcType="VARCHAR" />
+ <result column="operate_user_id" property="id" jdbcType="INTEGER" />
+ <result column="operate_user_name" property="name" jdbcType="VARCHAR" />
</association>
<association property="deviceVersion" javaType="com.moral.entity.DeviceVersion">
- <result column="id" property="id" jdbcType="INTEGER" />
- <result column="version" property="version" jdbcType="INTEGER" />
- <result column="name" property="name" jdbcType="VARCHAR" />
+ <result column="device_version_id" property="id" jdbcType="INTEGER" />
+ <result column="device_version_value" property="version" jdbcType="INTEGER" />
+ <result column="device_version_name" property="name" jdbcType="VARCHAR" />
</association>
- <association property="monitorpointDetail" javaType="com.moral.entity.MonitorPoint">
- <result column="id" property="id" jdbcType="INTEGER" />
- <result column="name" property="name" jdbcType="VARCHAR" />
+ <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>
</resultMap>
<sql id="Example_Where_Clause">
@@ -210,9 +210,11 @@
</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
+ from device dev
+ left join monitor_point mpt on dev.monitor_point_id = mpt.id
+ where dev.mac = #{mac,jdbcType=VARCHAR}
</select>
<select id="getDeviceCountByRegion" resultType="java.lang.Integer">
--
Gitblit v1.8.0