会员列表返回充值金额
This commit is contained in:
@@ -4,12 +4,24 @@ import com.czg.account.entity.ShopUser;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Administrator
|
* @author Administrator
|
||||||
*/
|
*/
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
public class ShopUserDTO extends ShopUser {
|
public class ShopUserDTO extends ShopUser {
|
||||||
|
/**
|
||||||
|
* 优惠券数量
|
||||||
|
*/
|
||||||
private Long couponNum;
|
private Long couponNum;
|
||||||
|
/**
|
||||||
|
* 订单数量
|
||||||
|
*/
|
||||||
private Long orderNumber;
|
private Long orderNumber;
|
||||||
|
/**
|
||||||
|
* 充值金额
|
||||||
|
*/
|
||||||
|
private BigDecimal rechargeAmount;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,12 +50,13 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="selectPageByKeyAndIsVip" resultType="com.czg.account.dto.shopuser.ShopUserDTO">
|
<select id="selectPageByKeyAndIsVip" resultType="com.czg.account.dto.shopuser.ShopUserDTO">
|
||||||
SELECT
|
SELECT
|
||||||
a.*, count(c.id) couponNum, count(d.id) orderNumber
|
a.*, count(c.id) couponNum, count(d.id) orderNumber, IFNULL(sum(f.amount), 0) rechargeAmount
|
||||||
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
|
left join tb_shop_activate_coupon_record c on c.shop_user_id=a.id and c.`status`=0
|
||||||
left join tb_order_info as d on d.user_id=a.user_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')
|
||||||
|
|
||||||
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