From 10ad2e710d2bd52aac31d5d63a7bb6beae76b6a8 Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Tue, 07 Nov 2023 14:35:32 +0800
Subject: [PATCH] 用户列表增加搜索条件

---
 src/main/resources/mapper/modules/ChatUserMapper.xml |   46 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 45 insertions(+), 1 deletions(-)

diff --git a/src/main/resources/mapper/modules/ChatUserMapper.xml b/src/main/resources/mapper/modules/ChatUserMapper.xml
index 0ee9ff4..ef87b68 100644
--- a/src/main/resources/mapper/modules/ChatUserMapper.xml
+++ b/src/main/resources/mapper/modules/ChatUserMapper.xml
@@ -32,6 +32,9 @@
                 <if test="record.status != null and record.status != ''">
                     and a.status = #{record.status}
                 </if>
+                <if test="record.isRobot != null">
+                    and a.is_robot = #{record.isRobot}
+                </if>
             </if>
         </where>
         group by a.user_id
@@ -66,6 +69,7 @@
         from chat_user a
         left join chat_wallet b on b.user_id = a.user_id and b.type = 'USDT'
         <where>
+            a.is_robot = 0
             <if test="record.phone != null and record.phone != ''">
                 and a.phone like CONCAT('%', CONCAT(#{record.phone}, '%'))
             </if>
@@ -181,9 +185,18 @@
         b.nick_name nickName,
         b.phone phone,
         a.id id,
-        a.amount amount,
+        (a.amount - a.fee) amount,
+        CASE
+            WHEN a.type = 1 THEN NULL
+        ELSE
+            FORMAT(
+                (a.amount - a.fee) / ( SELECT VALUE FROM data_dictionary WHERE type = 'USDT_TIME' AND CODE = 'USDT_TIME' ),
+                2
+            )
+        END AS amountUSDT,
         a.type type,
         a.address address,
+        a.address_type addressType,
         a.state state
         from member_coin_withdraw a
         left join chat_user b on b.user_id = a.user_id
@@ -312,6 +325,7 @@
         select
         a.*,
         b.nick_name nickName,
+        b.is_robot isRobot,
         c.name groupName
         from chat_red_bag a
         left join chat_user b on b.user_id = a.from_user_id
@@ -321,6 +335,12 @@
             <if test="record != null">
                 <if test="record.name != null and record.name != ''">
                     and c.name like CONCAT('%', CONCAT(#{record.name}, '%'))
+                </if>
+                <if test="record.nickName != null and record.nickName != ''">
+                    and b.nick_name like CONCAT('%', CONCAT(#{record.nickName}, '%'))
+                </if>
+                <if test="record.isRobot != null">
+                    and b.is_robot = #{record.isRobot}
                 </if>
             </if>
         </where>
@@ -435,5 +455,29 @@
         where user_id = #{userId}
     </update>
 
+    <delete  id="deleteMsgByCreateTime">
+        DELETE from chat_msg where create_time &lt; #{dateTime}
+    </delete>
+
+    <select id="selectChatRedBagByCreateTime" resultType="java.lang.Long">
+        select id
+        from chat_red_bag
+        where create_time &lt; #{dateTime} order By create_time desc limit 1
+    </select>
+
+    <delete  id="deleteChatRedBagById">
+        DELETE from chat_red_bag where id &lt; #{id}
+    </delete>
+
+    <select id="selectChatRedBagRecordByRebBagId" resultType="java.lang.Long">
+        select id
+        from chat_red_bag_record
+        where red_bag_id = #{id}
+    </select>
+
+    <delete  id="deleteChatRedBagRecordById">
+        DELETE from chat_red_bag_record where id &lt; #{id}
+    </delete>
+
 
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1