From a1d261d6c92c38d9e496e11d1bc224ecc1d34798 Mon Sep 17 00:00:00 2001
From: nickchange <126672920+nickchange@users.noreply.github.com>
Date: 星期二, 14 十一月 2023 09:14:57 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 cloud-server-management/src/main/resources/mapper/UserMapper.xml |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/cloud-server-management/src/main/resources/mapper/UserMapper.xml b/cloud-server-management/src/main/resources/mapper/UserMapper.xml
index a42cc57..71b8210 100644
--- a/cloud-server-management/src/main/resources/mapper/UserMapper.xml
+++ b/cloud-server-management/src/main/resources/mapper/UserMapper.xml
@@ -115,5 +115,35 @@
 		</where>
 		order by o.id desc
 	</select>
+    <select id="searchUsers" resultType="com.dsh.guns.modular.system.model.UserListVO">
+		select t1.id,t1.name ,t1.phone ,t1.avatar,t1.birthday,t1.sex,t1.idCard,t1.status
+		 ,t2.simplename as deptName from sys_user t1
+		 left join sys_dept t2 on t1.deptid = t2.id
+		<where>
+			<if test="query.name != null and query.name != ''">
+				and t1.name like CONCAT('%',#{query.name},'%')
+			</if>
+			<if test="query.phone != null and query.phone != ''">
+				and t1.phone like CONCAT('%',#{query.phone},'%')
+			</if>
+			<if test="query.idCard != null and query.idCard != ''">
+				and t1.idCard like CONCAT('%',#{query.idCard},'%')
+			</if>
+			<if test="query.isSales == 1">
+				and (t2.simplename like CONCAT('%','销售','%')
+				or t2.fullname like CONCAT('%','销售','%'))
+			</if>
+			<if test="query.status != null and query.status != ''">
+				and t1.status = #{query.status}
+			</if>
+			<if test="query.storeIds != null and query.storeIds.size()>0">
+				AND t1.id IN
+				<foreach collection="query.storeIds" separator="," item="id" open="(" close=")">
+					#{id}
+				</foreach>
+			</if>
+			and t1.status != 3
+		</where>
+	</select>
 
 </mapper>

--
Gitblit v1.7.1