会员余额明细获取
This commit is contained in:
@@ -39,14 +39,25 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAssetsSummary" resultType="com.czg.account.dto.user.userinfo.UserInfoAssetsSummaryDTO">
|
<select id="selectAssetsSummary" resultType="com.czg.account.dto.user.userinfo.UserInfoAssetsSummaryDTO">
|
||||||
select sum(IFNULL(b.amount, 0)) as amount,
|
SELECT
|
||||||
sum(IFNULL(b.account_points, 0)) as points,
|
SUM(amount) AS amount,
|
||||||
count(c.id) as couponNum
|
SUM(points) AS points,
|
||||||
from tb_user_info as a
|
COUNT(DISTINCT c.id) AS couponNum
|
||||||
join tb_shop_user as b on a.id = b.user_id
|
FROM (
|
||||||
join tb_shop_activate_coupon_record as c
|
SELECT
|
||||||
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()
|
b.id,
|
||||||
where a.id = #{userId}
|
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
|
||||||
|
AND c.`status` = 1
|
||||||
|
AND c.use_start_time < NOW()
|
||||||
|
AND c.use_end_time > NOW();
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
<select id="selectPageByKeyAndIsVip" resultType="com.czg.account.dto.shopuser.ShopUserDTO">
|
<select id="selectPageByKeyAndIsVip" resultType="com.czg.account.dto.shopuser.ShopUserDTO">
|
||||||
SELECT
|
SELECT
|
||||||
@@ -56,9 +67,11 @@
|
|||||||
FROM
|
FROM
|
||||||
tb_shop_user a
|
tb_shop_user a
|
||||||
left JOIN tb_user_info b ON b.id = a.user_id
|
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_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_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}
|
where a.shop_id=#{shopId}
|
||||||
<if test="isVip != null">
|
<if test="isVip != null">
|
||||||
|
|||||||
Reference in New Issue
Block a user