From 98a7cb217d580d8c2642570dc8298e9226551928 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期五, 01 八月 2025 18:44:28 +0800
Subject: [PATCH] bug修改

---
 ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TUserMapper.xml |   27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TUserMapper.xml b/ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TUserMapper.xml
index 4f2ae88..6990d57 100644
--- a/ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TUserMapper.xml
+++ b/ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TUserMapper.xml
@@ -46,6 +46,14 @@
         LEFT JOIN (select * from t_company where flag != 3) as ci on ci.id = ui.companyId
         LEFT JOIN (SELECT COUNT(id) as num,userId from t_order_taxi where FIND_IN_SET(state,'8,9') GROUP BY userId) as ot on ot.userId = ui.id
         LEFT JOIN (SELECT sum(money) as num,userId from t_pub_transaction_details where userType = 1 and type = 1 and state = 2 GROUP BY userId) as td on td.userId = ui.id
+        LEFT JOIN t_invite inv1 on (ui.id = inv1.userId and inv1.userType = 1)
+        left join t_user uu on (inv1.inviteUserId = uu.id)
+        LEFT JOIN t_invite inv2 on (ui.id = inv2.userId and inv2.userType = 2)
+        left join t_driver dd on (inv2.inviteUserId = dd.id)
+        where 1 = 1
+        <if test="inviteUser != null and inviteUser != ''">
+            and (uu.phone  LIKE CONCAT('%',#{inviteUser},'%') or dd.phone  LIKE CONCAT('%',#{inviteUser},'%'))
+        </if>
         ) as o
         <where>
             o.flag != 3
@@ -99,10 +107,12 @@
 
     <!--根据条件查询用户列表-无分页-->
     <select id="getUserListNoPage" resultType="map" >
-        SELECT * FROM (SELECT ci.`name` as companyName,IFNULL(ot.num,0) as historyNum,IFNULL(td.num,0) as consumptionNum,ui.* from t_user as ui
+        SELECT * FROM (SELECT ci.`name` as companyName,IFNULL(ot.num,0) as historyNum,IFNULL(td.num,0) as consumptionNum,ti.inviteNumber,ui.* from t_user as ui
         LEFT JOIN (select * from t_company where flag != 3) as ci on ci.id = ui.companyId
         LEFT JOIN (SELECT COUNT(id) as num,userId from t_order_taxi where FIND_IN_SET(state,'8,9') GROUP BY userId) as ot on ot.userId = ui.id
         LEFT JOIN (SELECT sum(money) as num,userId from t_pub_transaction_details where userType = 1 and type = 1 and state = 2 GROUP BY userId) as td on td.userId = ui.id
+        LEFT JOIN (select COUNT(id) as inviteNumber,inviteUserId from t_invite  where userType =1 GROUP BY inviteUserId)as ti on ti.inviteUserId = ui.id
+
         ) as o
         <where>
             o.flag != 3
@@ -115,6 +125,21 @@
         </where>
         order by o.id desc
     </select>
+    <select id="inviteList" resultType="java.util.Map">
+        select t1.*,t2.phone,t2.avatar,t2.nickName from t_invite t1
+        left join t_user t2 on t2.id = t1.userId
+        where 1=1
+        <if test="null != uid">
+            and t1.inviteUserId = #{uid}
+        </if>
+        <if test="inviteName != null and inviteName != ''">
+            and t2.nickName  LIKE CONCAT('%',#{inviteName},'%')
+        </if>
+        <if test="null != startTime and null != endTime">
+            and t1.registerTime between #{startTime} and #{endTime}
+        </if>
+        order by t1.registerTime desc
+    </select>
 
 
 </mapper>

--
Gitblit v1.7.1