From 61631227899badaf6c8474ab9c1722a2a6fc651c Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Fri, 16 Jul 2021 17:10:50 +0800
Subject: [PATCH] fix
---
gc-user/src/main/resources/mapper/user/AccountMapper.xml | 52 +++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 43 insertions(+), 9 deletions(-)
diff --git a/gc-user/src/main/resources/mapper/user/AccountMapper.xml b/gc-user/src/main/resources/mapper/user/AccountMapper.xml
index eb04b45..bf793c1 100644
--- a/gc-user/src/main/resources/mapper/user/AccountMapper.xml
+++ b/gc-user/src/main/resources/mapper/user/AccountMapper.xml
@@ -252,11 +252,14 @@
a.order_no orderNo,
a.score scoreReward,
a.amount amountReward,
+ c.nick_name nickname,
+ c.mobile_phone phone,
(select sum(score) from xzx_jhy_order_items where b.id = order_id) score,
(select sum(score/ 40) from xzx_jhy_order_items where b.id = order_id) amount
FROM
xzx_user_head_details a
LEFT JOIN xzx_jhy_order b ON a.order_no = b.order_no
+ LEFT JOIN xzx_user_info c on a.user_id = c.user_id
WHERE
a.head_user_id = #{userId}
</select>
@@ -289,11 +292,8 @@
<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 test="record.queryCol != null and record.queryCol != ''">
+ and (b.nick_name like concat('%',#{record.name},'%') or b.mobile_phone like concat('%',#{record.phone},'%'))
</if>
<if test="record.reserveTimeStart != null">
and b.regist_time >= #{record.reserveTimeStart}
@@ -308,11 +308,12 @@
<select id="selectOrderByHeadUserId" resultType="java.lang.String">
SELECT
- IFNULL(SUM(weight),0) as kg
+ IFNULL(SUM(a.weight),0) as kg
FROM
- xzx_jhy_order_items
+ xzx_jhy_order_items a
+ left join xzx_sys_environmental_info b on a.item_type = b.id
WHERE
- order_id in (
+ b.item_unit = 'kg' and a.order_id in (
SELECT
id
FROM
@@ -372,7 +373,8 @@
SELECT
IFNULL(count(1), 0) cnt,
SUM((select IFNULL(count(1), 0) from xzx_user_head_details where head_user_id = a.user_id) ) orderCnt,
- SUM((select IFNULL(sum(amount), 0) from xzx_user_head_details where head_user_id = a.user_id) ) amount
+ SUM((select IFNULL(sum(amount), 0) from xzx_user_head_details where head_user_id = a.user_id) ) amount,
+ SUM((select IFNULL(sum(score), 0) from xzx_user_head_details where head_user_id = a.user_id) ) score
FROM
xzx_account_info a
where
@@ -380,4 +382,36 @@
and a.is_head = 1
</select>
+ <select id="distribDataExport" 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.queryCol != null and record.queryCol != ''">
+ and (b.nick_name like concat('%',#{record.name},'%') or 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