From 43086924a890e1ae64ab98f9b844c3cf8a0b88c8 Mon Sep 17 00:00:00 2001
From: fengxiang <110431245@qq.com>
Date: Thu, 17 May 2018 17:21:19 +0800
Subject: [PATCH] 地图搜索功能增强

---
 src/main/resources/mapper/DeviceMapper.xml |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/main/resources/mapper/DeviceMapper.xml b/src/main/resources/mapper/DeviceMapper.xml
index 2808a19..35c4788 100644
--- a/src/main/resources/mapper/DeviceMapper.xml
+++ b/src/main/resources/mapper/DeviceMapper.xml
@@ -171,13 +171,21 @@
 		left join monitor_point mpt on dev.monitor_point_id = mpt.id
 		left join device_version dve on dev.device_version_id = dve.id
 		<where>
-			<if test="@com.moral.common.bean.Constants@isNotSpecialOrgId(orgId)">
-				mpt.organization_id =  #{orgId}
-			</if>
-		<if test="devName!=null and ''!=devName">
-			and dev.name like CONCAT('%',#{devName},'%')
+		<if test="@com.moral.common.bean.Constants@isNotSpecialOrgId(orgId)">
+			mpt.organization_id =  #{orgId}
 		</if>
 			and dev.is_delete = 0
+			and (
+			<![CDATA[
+			 1 <> 1
+			]]>
+			<if test="name!=null and ''!=name">
+				or dev.name like CONCAT('%',#{name},'%')
+				or dev.mac like CONCAT('%',#{name},'%')
+				or mpt.name like CONCAT('%',#{name},'%')
+			</if>
+			)
+
 		</where>
 	</select>
 	<select id="selectByOrgIdAndMpId" resultMap="BaseResultMap">

--
Gitblit v1.8.0