会员列表
This commit is contained in:
parent
c309e73575
commit
4120d463d2
|
|
@ -40,23 +40,18 @@
|
|||
|
||||
<select id="selectAssetsSummary" resultType="com.czg.account.dto.user.userinfo.UserInfoAssetsSummaryDTO">
|
||||
SELECT
|
||||
SUM(amount) AS amount,
|
||||
SUM(points) AS points,
|
||||
IFNULL(SUM(b.amount), 0) AS amount,
|
||||
IFNULL(SUM(b.account_points), 0) AS points,
|
||||
COUNT(DISTINCT c.id) AS couponNum
|
||||
FROM (
|
||||
SELECT
|
||||
b.id,
|
||||
IFNULL(b.amount, 0) AS amount,
|
||||
IFNULL(b.account_points, 0) AS points
|
||||
FROM tb_shop_user AS b
|
||||
WHERE b.user_id = #{userId}
|
||||
) AS sub_b
|
||||
LEFT JOIN tb_shop_activate_coupon_record AS c
|
||||
ON c.shop_id = sub_b.id
|
||||
AND c.shop_user_id = sub_b.id
|
||||
ON c.shop_id = b.shop_id
|
||||
AND c.shop_user_id = b.id
|
||||
AND c.`status` = 1
|
||||
AND c.use_start_time < NOW()
|
||||
AND c.use_end_time > NOW();
|
||||
AND c.use_end_time > NOW()
|
||||
WHERE b.user_id = #{userId};
|
||||
|
||||
|
||||
</select>
|
||||
<select id="selectPageByKeyAndIsVip" resultType="com.czg.account.dto.shopuser.ShopUserDTO">
|
||||
|
|
@ -66,12 +61,10 @@
|
|||
IFNULL(SUM(DISTINCT f.amount), 0) AS rechargeAmount
|
||||
FROM
|
||||
tb_shop_user a
|
||||
left JOIN tb_user_info b ON b.id = a.user_id
|
||||
left join tb_shop_activate_coupon_record c on c.shop_user_id=a.id and c.`status`=0 and c.use_start_time <
|
||||
now() and c.use_end_time > now()
|
||||
LEFT JOIN tb_user_info b ON b.id = a.user_id
|
||||
left join tb_shop_activate_coupon_record c on c.shop_user_id=a.id and c.`status`=0 and c.use_start_time < now() and c.use_end_time > now()
|
||||
left join tb_order_info as d on d.user_id=a.user_id and d.shop_id=a.shop_id
|
||||
left join tb_shop_user_flow as f on f.user_id=a.user_id and f.shop_id=a.shop_id and f.biz_code in ('cashIn',
|
||||
'wechatIn', 'alipayIn')
|
||||
left join tb_shop_user_flow as f on f.user_id=a.user_id and f.shop_id=a.shop_id and f.biz_code in ('cashIn', 'wechatIn', 'alipayIn')
|
||||
|
||||
where a.shop_id=#{shopId}
|
||||
<if test="isVip != null">
|
||||
|
|
|
|||
Loading…
Reference in New Issue