From 22c82c833f4411a75714e8e62f1380bd463ca537 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Thu, 15 Jul 2021 14:59:57 +0800
Subject: [PATCH] Merge branch 'score-shop' of http://120.27.238.55:7000/r/xzx into score-shop
---
gc-user/src/main/resources/mapper/user/AccountMapper.xml | 96 ++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 92 insertions(+), 4 deletions(-)
diff --git a/gc-user/src/main/resources/mapper/user/AccountMapper.xml b/gc-user/src/main/resources/mapper/user/AccountMapper.xml
index cdb5525..1d90ccf 100644
--- a/gc-user/src/main/resources/mapper/user/AccountMapper.xml
+++ b/gc-user/src/main/resources/mapper/user/AccountMapper.xml
@@ -174,10 +174,10 @@
b.mobile_phone phone,
b.regist_time registTime,
a.is_head isHead,
- (select IFNULL(count(1), 0) from xzx_user_head_relate where head_user_id = a.user_id GROUP BY head_user_id) cnt,
- (select IFNULL(count(1), 0) from xzx_user_head_details where head_user_id = a.user_id GROUP BY head_user_id) orderCnt,
- (select IFNULL(sum(amount), 0) from xzx_user_head_relate where head_user_id = a.user_id GROUP BY head_user_id) amount,
- (select IFNULL(sum(score), 0) from xzx_user_head_relate where head_user_id = a.user_id GROUP BY head_user_id) score,
+ (select IFNULL(count(1), 0) from xzx_user_head_relate where head_user_id = a.user_id ) cnt,
+ (select IFNULL(count(1), 0) from xzx_user_head_details where head_user_id = a.user_id ) orderCnt,
+ (select IFNULL(sum(amount), 0) from xzx_user_head_relate where head_user_id = a.user_id ) amount,
+ (select IFNULL(sum(score), 0) from xzx_user_head_relate where head_user_id = a.user_id ) score,
a.is_prohibit isProhibit
FROM
xzx_account_info a
@@ -202,4 +202,92 @@
order by id desc
</select>
+ <select id="selectDistribByAccountId" resultType="com.xzx.gc.user.vo.ViewDistribInfoVo">
+ SELECT
+ a.account_id id,
+ b.nick_name nickname,
+ b.mobile_phone phone,
+ b.regist_time registTime,
+ (select IFNULL(count(1), 0) from xzx_user_head_relate where head_user_id = a.user_id ) cnt,
+ (select IFNULL(count(1), 0) from xzx_user_head_details where head_user_id = a.user_id ) orderCnt,
+ (select IFNULL(sum(amount), 0) from xzx_user_head_relate where head_user_id = a.user_id ) amount,
+ (select IFNULL(sum(score), 0) from xzx_user_head_relate where head_user_id = a.user_id ) score
+ FROM
+ xzx_account_info a
+ LEFT JOIN xzx_user_info b on a.user_id = b.user_id
+ where a.account_id = #{id}
+ </select>
+
+ <select id="selectUserHeadInfoByAccountId" resultType="com.xzx.gc.user.vo.UserHeadInfoVo">
+ SELECT
+ b.nick_name nickname,
+ b.mobile_phone phone,
+ a.CREATED_TIME createTime,
+ (select IFNULL(count(1), 0) from xzx_user_head_details where user_id = a.user_id and head_user_id = #{id}) orderCnt,
+ (select IFNULL(sum(amount), 0) from xzx_user_head_details where user_id = a.user_id and head_user_id = #{id}) amount
+ FROM
+ xzx_user_head_relate a
+ LEFT JOIN xzx_user_info b on a.user_id = b.user_id
+ where a.head_user_id = #{id}
+ </select>
+
+ <select id="selectOrderItemsByUserId" resultType="com.xzx.gc.user.vo.OrderItemsVo">
+ SELECT
+ b.id orderId,
+ a.order_no orderNo,
+ a.score scoreReward,
+ a.amount amountReward,
+ sum(c.score) amount
+ FROM
+ xzx_user_head_details a
+ LEFT JOIN xzx_jhy_order b on a.order_no = b.order_no
+ LEFT JOIN xzx_jhy_order_items c on b.id=c.order_id
+ where a.head_user_id = #{userId}
+ </select>
+
+
+
+ <select id="selectOrderById" resultType="com.xzx.gc.entity.JhyOrderItems">
+ SELECT
+ *
+ FROM
+ xzx_jhy_order_items a
+ where a.order_id = #{orderId}
+ </select>
+
+ <select id="distribDataList" resultType="com.xzx.gc.user.vo.DistribDataListVo">
+ SELECT
+ a.account_id id,
+ b.nick_name nickname,
+ b.mobile_phone phone,
+ b.regist_time registTime,
+ a.is_head isHead,
+ (select IFNULL(count(1), 0) from xzx_user_head_relate where head_user_id = a.user_id) cnt,
+ (select IFNULL(count(1), 0) from xzx_user_head_details where head_user_id = a.user_id) orderCnt,
+ (select IFNULL(sum(amount), 0) from xzx_user_head_relate where head_user_id = a.user_id) amount,
+ (select IFNULL(sum(score), 0) from xzx_user_head_relate where head_user_id = a.user_id ) score,
+ a.is_prohibit isProhibit
+ FROM
+ xzx_account_info a
+ LEFT JOIN xzx_user_info b on a.user_id = b.user_id
+ <where>
+ 1=1
+ and a.is_head = 1
+ <if test="record.name != null and record.name != ''">
+ and b.nick_name like concat('%',#{record.name},'%')
+ </if>
+ <if test="record.phone != null and record.phone != ''">
+ and b.mobile_phone like concat('%',#{record.phone},'%')
+ </if>
+ <if test="record.reserveTimeStart != null">
+ and b.regist_time >= #{record.reserveTimeStart}
+ </if>
+
+ <if test="record.reserveTimeEnd != null">
+ and b.regist_time <= #{record.reserveTimeEnd}
+ </if>
+ </where>
+ order by id desc
+</select>
+
</mapper>
--
Gitblit v1.9.1