From c6bb4daa335c7615610ca0f7e404ca7aa2825dce Mon Sep 17 00:00:00 2001
From: zhujie <leon.zhu@cloudroam.com.cn>
Date: 星期五, 11 四月 2025 17:31:35 +0800
Subject: [PATCH] Merge branch 'master' of http://47.96.225.205:8888/r/smart_message

---
 src/main/java/com/mzl/flower/mapper/customer/CustomerMapper.java |   11 +++++++++++
 1 files changed, 11 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 c1f8002..2a1ee52 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,7 @@
 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;
@@ -42,5 +43,15 @@
     @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 user_id as userId,name as userName,t1.reward 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();
+
     void checkVipExpireTime();
 }

--
Gitblit v1.9.3