From b428226d0cf78bbb843fa17bffb1e338230fae6c Mon Sep 17 00:00:00 2001
From: tj <1378534974@qq.com>
Date: 星期一, 21 四月 2025 15:39:59 +0800
Subject: [PATCH] 1.我的邀请记录-头像

---
 src/main/java/com/mzl/flower/mapper/customer/CustomerMapper.java |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/mzl/flower/mapper/customer/CustomerMapper.java b/src/main/java/com/mzl/flower/mapper/customer/CustomerMapper.java
index f36c8d7..4fa9a5b 100644
--- a/src/main/java/com/mzl/flower/mapper/customer/CustomerMapper.java
+++ b/src/main/java/com/mzl/flower/mapper/customer/CustomerMapper.java
@@ -4,6 +4,8 @@
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.mzl.flower.dto.request.customer.QueryCustomerDTO;
 import com.mzl.flower.dto.response.customer.CustomerDTO;
+import com.mzl.flower.dto.response.customer.InviteDTO;
+import com.mzl.flower.dto.response.supplier.SupplierDTO;
 import com.mzl.flower.entity.customer.Customer;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
@@ -37,4 +39,51 @@
     Boolean updateMemberLevelByPoint(@Param("levelId") Long levelId, @Param("startPoint") int startPoint, @Param("endPoint") int endPoint);
 
 
+
+    @Select("select * from t_customer_info where  user_id  = ( select id from t_user where tel =#{phone} and type = 'customer')")
+    CustomerDTO findCustomerByPhone(String phone);
+
+    @Select("select * from t_customer_info where  intervialcode  =#{code}")
+    Customer findCustomerByInvitationCode(@Param("code") String code);
+
+    @Select("select count(1) from t_customer_info where reintervialcode = #{code}")
+    Integer getInvitatCountByCode(@Param("code") String code);
+
+    @Select("SELECT " +
+            "    c.user_id as userId," +
+            "    c.name as userName," +
+            "    CASE " +
+            "        WHEN t1.reward < 3 THEN '获得了3天会员' " +
+            "        WHEN t1.reward >= 3 AND t1.reward < 5 THEN '获得了15天会员' " +
+            "        WHEN t1.reward >=5 THEN '获得了30天会员' " +
+            "        ELSE '' " +
+            "    END AS reward ," +
+            "    '已注册' as status " +
+            "FROM " +
+            "    t_customer_info c " +
+            "    INNER JOIN (" +
+            "        SELECT " +
+            "            reintervialcode, " +
+            "            COUNT(DISTINCT id) AS reward" +
+            "        FROM " +
+            "            t_customer_info " +
+            "        WHERE " +
+            "            reintervialcode IS NOT NULL " +
+            "            AND reintervialcode <> '' " +
+            "        GROUP BY " +
+            "            reintervialcode " +
+            "    ) t1 ON c.intervialcode = t1.reintervialcode")
+    List<InviteDTO> getReward();
+
+    @Select("SELECT " +
+            "c.user_id AS userId, " +
+            "c.NAME AS userName, " +
+            "'' AS reward, " +
+            "'已注册' AS STATUS , c.cover  " +
+            "FROM " +
+            "t_customer_info c " +
+            "WHERE " +
+            "reintervialcode IN ( SELECT intervialcode FROM t_customer_info WHERE user_id = #{userid} )")
+    List<InviteDTO> getMyReward(String userid);
+    void checkVipExpireTime();
 }

--
Gitblit v1.9.3