fix: 推广员提成信息查询和导出. 商城提成
parent
160f9d306f
commit
2741f1cefe
|
@ -29,7 +29,7 @@ public class PromoterDrawReqVO extends PageParam {
|
|||
@Schema(description = "成为推广员时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
|
||||
@Schema(description = "排序1升序2降序")
|
||||
private String sort;
|
||||
|
||||
}
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
-->
|
||||
|
||||
|
||||
<select id="findPromoterDrawPage" resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.PromoterDrawVO">
|
||||
<select id="findPromoterDrawPage"
|
||||
resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.PromoterDrawVO">
|
||||
SELECT
|
||||
x1.*,
|
||||
x2.order_count,
|
||||
|
@ -65,30 +66,37 @@
|
|||
cy_recharge_order b
|
||||
GROUP BY
|
||||
b.promoter_id
|
||||
) x2 ON x1.user_id = x2.user_id ORDER BY x2.total_amount DESC
|
||||
) x2 ON x1.user_id = x2.user_id
|
||||
<if test="data.sort !=null and data.sort=1">
|
||||
ORDER BY x2.total_amount ASC
|
||||
</if>
|
||||
<if test="data.sort !=null and data.sort=2">
|
||||
ORDER BY x2.total_amount DESC
|
||||
</if>
|
||||
</select>
|
||||
<select id="findPromoterDrawCount" resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.PromoterDrawVO">
|
||||
<select id="findPromoterDrawCount"
|
||||
resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.PromoterDrawVO">
|
||||
SELECT
|
||||
b.promoter_id AS user_id,
|
||||
count( CASE b.paid = 1 WHEN 1 THEN 0 END) AS order_count,
|
||||
sum( CASE WHEN b.paid = 1 THEN b.pay_price ELSE 0 END ) AS deal_amount,
|
||||
count( CASE b.paid = 1 WHEN 1 THEN 0 END) AS order_count,
|
||||
sum( CASE WHEN b.paid = 1 THEN b.pay_price ELSE 0 END ) AS deal_amount,
|
||||
sum( CASE WHEN b.paid IN ( 1, 2 ) THEN b.pay_price ELSE 0 END ) AS total_amount
|
||||
FROM
|
||||
cy_recharge_order b
|
||||
<where>
|
||||
<if test="promoterIds!=null and promoterIds.size()>0">
|
||||
and b.promoter_id in
|
||||
<foreach collection="promoterIds" separator="," open="(" close=")" item="id">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
<where>
|
||||
<if test="promoterIds!=null and promoterIds.size()>0">
|
||||
and b.promoter_id in
|
||||
<foreach collection="promoterIds" separator="," open="(" close=")" item="id">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY b.promoter_id
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="findListPage" resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderRespVO">
|
||||
<select id="findListPage"
|
||||
resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderRespVO">
|
||||
select
|
||||
a.order_id,
|
||||
a.pay_serial_number,
|
||||
|
@ -127,7 +135,8 @@
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="findListExcel" resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderExcelVO">
|
||||
<select id="findListExcel"
|
||||
resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderExcelVO">
|
||||
select
|
||||
a.id,
|
||||
a.order_id,
|
||||
|
|
Loading…
Reference in New Issue