From 727a69f859060093e685582fa10e5de82dcc138a Mon Sep 17 00:00:00 2001
From: Van333 <van666666@foxmail.com>
Date: 星期四, 29 十二月 2022 15:37:49 +0800
Subject: [PATCH] 放假备份。完成集中控制器对接。
---
dao/src/main/resources/mapper/PoleMapper.xml | 32 ++++++++++++++++++++++++++++++--
1 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/dao/src/main/resources/mapper/PoleMapper.xml b/dao/src/main/resources/mapper/PoleMapper.xml
index cabb7c5..e05972e 100644
--- a/dao/src/main/resources/mapper/PoleMapper.xml
+++ b/dao/src/main/resources/mapper/PoleMapper.xml
@@ -9,6 +9,7 @@
<result property="poleCode" column="pole_code" jdbcType="BIGINT"/>
<result property="poleName" column="pole_name" jdbcType="VARCHAR"/>
<result property="deviceType" column="device_type" jdbcType="INTEGER"/>
+ <result property="centre" column="centre" jdbcType="INTEGER"/>
<result property="userId" column="user_id" jdbcType="BIGINT"/>
<result property="clientId" column="client_id" jdbcType="BIGINT"/>
<result property="province" column="province" jdbcType="VARCHAR"/>
@@ -46,12 +47,14 @@
LEFT JOIN pole_group_relation t2 ON t1.id = t2.pole_id
LEFT JOIN pole_group t3 ON t3.group_id = t2.pole_group_id
<where>
+ 1=1
<if test="userid != null">
AND (t1.user_id = #{userid} OR t1.client_id = #{userid})
</if>
<if test="keyword != null and keyword != ''">
AND ( t1.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
- OR t1.device_code LIKE CONCAT(CONCAT('%', #{keyword}), '%'))
+ OR t1.device_code LIKE CONCAT(CONCAT('%', #{keyword}), '%')
+ OR t1.centre LIKE CONCAT(CONCAT('%', #{keyword}), '%'))
</if>
<if test="isTrue != null and isTrue == 1">
AND t1.device_type = -1
@@ -68,10 +71,35 @@
<if test="bingStates != null and bingStates == 1 ">
AND t1.user_id = -1
</if>
+ <if test="centre != null and centre == 0">
+ AND t1.centre = 0
+ </if>
+ <if test="centre != null and centre == 1">
+ AND t1.centre = 1
+ </if>
</where>
GROUP BY t1.id
<if test="orderBy != null">
- ORDER BY ${orderBy}
+ ORDER BY ${orderBy}
</if>
</select>
+ <select id="getPoleListOnBinding" resultType="com.sandu.ximon.dao.domain.Pole">
+ SELECT
+ t1.*
+ FROM
+ pole t1
+ LEFT JOIN pole_group_relation t2 ON t1.id = t2.pole_id
+ LEFT JOIN pole_group t3 ON t3.group_id = t2.pole_group_id
+ <where>
+ <if test="userid != null">
+ AND (t1.user_id = #{userid} OR t1.client_id = #{userid})
+ </if>
+ <if test="keyword != null and keyword != ''">
+ AND ( t1.id LIKE CONCAT(CONCAT('%', #{keyword}), '%')
+ OR t1.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%'))
+ </if>
+ </where>
+ GROUP BY t1.id
+
+ </select>
</mapper>
--
Gitblit v1.9.3