From e6f678873579e9356c78042179dd03cc5d8a9718 Mon Sep 17 00:00:00 2001
From: fengxiang <110431245@qq.com>
Date: Tue, 08 May 2018 17:30:47 +0800
Subject: [PATCH] 运维app拉出设备信息完善 行业
---
src/main/resources/mapper/DeviceMapper.xml | 9 ++++++++-
src/main/java/com/moral/entity/Device.java | 3 ++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/moral/entity/Device.java b/src/main/java/com/moral/entity/Device.java
index 0f170b7..36ec4d7 100644
--- a/src/main/java/com/moral/entity/Device.java
+++ b/src/main/java/com/moral/entity/Device.java
@@ -113,5 +113,6 @@
private MonitorPoint monitorPoint;
@Transient
private List<Integer> organizationIds;
-
+ @Transient
+ private Profession profession;
}
\ No newline at end of file
diff --git a/src/main/resources/mapper/DeviceMapper.xml b/src/main/resources/mapper/DeviceMapper.xml
index 36ce410..3fb35f3 100644
--- a/src/main/resources/mapper/DeviceMapper.xml
+++ b/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">
@@ -211,9 +216,11 @@
<select id="selectWithOrgIdsByMac" parameterType="java.lang.String" resultMap="BaseResultWithOrgIdsMap">
select
dev.*,
- mpt.name as monitor_point_name
+ 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>
--
Gitblit v1.8.0