|
@@ -10,7 +10,12 @@
|
|
|
from (select promoter_id as 'promoterId',
|
|
|
promoter_nick_name as 'promoterNickName',
|
|
|
count(oid) as 'orderNum',
|
|
|
- sum(case when order_status != 80 then 1 else 0 end) as 'validOrderNUm'
|
|
|
+ sum(case when order_status != 80 then 1 else 0 end) as 'validOrderNUm',
|
|
|
+ round(sum(case when order_status != 80 then 1 else 0 end) / count(oid),4) as 'validRadio',
|
|
|
+ sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) as 'deliveryNum',
|
|
|
+ round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case when order_status != 80
|
|
|
+ then 1 else 0 end),4) as 'deliveryRadio'
|
|
|
+
|
|
|
from kuaishou_supply_chain
|
|
|
where 1= 1
|
|
|
<if test="start != null and start != ''">
|
|
@@ -54,8 +59,13 @@
|
|
|
image_url 'imageUrl',
|
|
|
count(oid) as 'orderNum',
|
|
|
sum(case when order_status != 80 then 1 else 0 end) as 'validOrderNUm',
|
|
|
+ round(sum(case when order_status != 80 then 1 else 0 end) / count(oid),4) as 'validRadio',
|
|
|
sum(case when order_status != 80 then pay_amount else 0 end) as 'payAmount',
|
|
|
- regimental_promotion_rate as 'regimentalPromotionRate'
|
|
|
+ regimental_promotion_rate as 'regimentalPromotionRate',
|
|
|
+ sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) as 'deliveryNum',
|
|
|
+ round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case when order_status != 80
|
|
|
+ then 1 else 0 end),4) as 'deliveryRadio'
|
|
|
+
|
|
|
from kuaishou_supply_chain
|
|
|
where 1= 1
|
|
|
<if test="promoterId != null and promoterId != ''">
|
|
@@ -105,7 +115,11 @@
|
|
|
item_title as 'itemTitle',
|
|
|
image_url as 'imageUrl',
|
|
|
count(oid) as 'orderNum',
|
|
|
- sum(case when order_status != 80 then 1 else 0 end) as 'validOrderNUm'
|
|
|
+ sum(case when order_status != 80 then 1 else 0 end) as 'validOrderNUm',
|
|
|
+ round(sum(case when order_status != 80 then 1 else 0 end) / count(oid),4) as 'validRadio',
|
|
|
+ sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) as 'deliveryNum',
|
|
|
+ round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case when order_status != 80
|
|
|
+ then 1 else 0 end),4) as 'deliveryRadio'
|
|
|
from kuaishou_supply_chain
|
|
|
where 1= 1
|
|
|
<if test="start != null and start != ''">
|
|
@@ -148,9 +162,13 @@
|
|
|
promoter_nick_name as 'promoterNickName',
|
|
|
promoter_id as 'promoterId',
|
|
|
count(oid) as 'orderNum',
|
|
|
- sum(case when order_status != 80 then 1 else 0 end) as 'validOrderNUm',
|
|
|
sum(case when order_status != 80 then pay_amount else 0 end) as 'payAmount',
|
|
|
- regimental_promotion_rate as 'regimentalPromotionRate'
|
|
|
+ regimental_promotion_rate as 'regimentalPromotionRate',
|
|
|
+ sum(case when order_status != 80 then 1 else 0 end) as 'validOrderNUm',
|
|
|
+ round(sum(case when order_status != 80 then 1 else 0 end) / count(oid),4) as 'validRadio',
|
|
|
+ sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) as 'deliveryNum',
|
|
|
+ round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case when order_status != 80
|
|
|
+ then 1 else 0 end),4) as 'deliveryRadio'
|
|
|
from kuaishou_supply_chain
|
|
|
where 1= 1
|
|
|
<if test="itemId != null and itemId != ''">
|
|
@@ -180,6 +198,10 @@
|
|
|
image_url as 'imageUrl',
|
|
|
count(oid) as 'orderNum',
|
|
|
sum(case when order_status != 80 then 1 else 0 end) as 'validOrderNUm',
|
|
|
+ round(sum(case when order_status != 80 then 1 else 0 end) / count(oid),4) as 'validRadio',
|
|
|
+ sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) as 'deliveryNum',
|
|
|
+ round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case when order_status != 80
|
|
|
+ then 1 else 0 end),4) as 'deliveryRadio',
|
|
|
sum(case when order_status = 80 then 1 else 0 end) as 'invalidOrderNUm',
|
|
|
regimental_promotion_rate as 'regimentalPromotionRate',
|
|
|
sum(case when order_status != 80 then pay_amount else 0 end) as 'payAmount',
|
|
@@ -303,8 +325,8 @@
|
|
|
sum(case when order_status != 80 then 1 else 0 end) as 'validOrderNUm',
|
|
|
round(sum(case when order_status != 80 then 1 else 0 end) / count(oid),4) as 'validRadio',
|
|
|
sum(case when send_status = 1 then 1 else 0 end) as 'deliveryNum',
|
|
|
- round(sum(case when send_status = 1 then 1 else 0 end) / sum(case when order_status != 80 then 1 else 0 end),4) as 'deliveryRadio'
|
|
|
-
|
|
|
+ round(sum(case when send_status = 1 then 1 else 0 end) / sum(case when order_status != 80 then 1 else 0 end),4)
|
|
|
+ as 'deliveryRadio'
|
|
|
from kuaishou_supply_chain
|
|
|
where 1= 1
|
|
|
<if test="nowStartHourTemp != null and nowStartHourTemp != ''">
|
|
@@ -340,7 +362,8 @@
|
|
|
sum(case when order_status != 80 then 1 else 0 end) as 'validOrderNUm',
|
|
|
round(sum(case when order_status != 80 then 1 else 0 end) / count(oid),4) as 'validRadio',
|
|
|
sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) as 'deliveryNum',
|
|
|
- round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case when order_status != 80 then 1 else 0 end),4) as 'deliveryRadio'
|
|
|
+ round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case when order_status != 80
|
|
|
+ then 1 else 0 end),4) as 'deliveryRadio'
|
|
|
from kuaishou_supply_chain
|
|
|
where 1= 1
|
|
|
<if test="start != null and start != ''">
|
|
@@ -356,7 +379,8 @@
|
|
|
select
|
|
|
t1.*,
|
|
|
round((t1.orderNum - t2.orderNum) / t2.orderNum,4) as 'radio'
|
|
|
- from (select
|
|
|
+ from (
|
|
|
+ select
|
|
|
promoter_id as 'promoterId',
|
|
|
promoter_nick_name as 'promoterNickName',
|
|
|
count(oid) as 'orderNum',
|
|
@@ -406,4 +430,81 @@
|
|
|
group by promoter_id) t
|
|
|
order by t.orderNum desc
|
|
|
</select>
|
|
|
+ <select id="exportPromoter" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
+ select *
|
|
|
+ from (
|
|
|
+ select
|
|
|
+ promoter_id as 'promoterId',
|
|
|
+ promoter_nick_name as 'promoterNickName',
|
|
|
+ item_id as 'itemId',
|
|
|
+ item_title as 'itemTitle',
|
|
|
+ image_url as 'imageUrl',
|
|
|
+ count(oid) as 'orderNum',
|
|
|
+ sum(case when order_status != 80 then 1 else 0 end) as 'validOrderNUm',
|
|
|
+ round(sum(case when order_status != 80 then 1 else 0 end) / count(oid) * 100,2) as 'validRadio',
|
|
|
+ sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) as 'deliveryNum',
|
|
|
+ round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case when order_status != 80
|
|
|
+ then 1 else 0 end) * 100,2) as 'deliveryRadio'
|
|
|
+ from kuaishou_supply_chain
|
|
|
+ where 1= 1
|
|
|
+ <if test="start != null and start != ''">
|
|
|
+ and order_create_time >= #{start}
|
|
|
+ </if>
|
|
|
+ <if test="end != null and end != ''">
|
|
|
+ and order_create_time <= #{end}
|
|
|
+ </if>
|
|
|
+ <if test="promoterId != null and promoterId != ''">
|
|
|
+ and promoter_id = #{promoterId}
|
|
|
+ </if>
|
|
|
+ <if test="promoterNickName != null and promoterNickName != ''">
|
|
|
+ and promoter_nick_name like concat(concat('%',#{promoterNickName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="itemId != null and itemId != ''">
|
|
|
+ and item_id = #{itemId}
|
|
|
+ </if>
|
|
|
+ <if test="itemTitle != null and itemTitle != ''">
|
|
|
+ and item_title like concat(concat('%',#{itemTitle}),'%')
|
|
|
+ </if>
|
|
|
+ group by promoter_id,item_id) t
|
|
|
+ order by t.promoterId,t.orderNum desc
|
|
|
+
|
|
|
+ </select>
|
|
|
+ <select id="exportOrder" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
+ select *
|
|
|
+ from (
|
|
|
+ select
|
|
|
+ item_id as 'itemId',
|
|
|
+ item_title as 'itemTitle',
|
|
|
+ image_url as 'imageUrl',
|
|
|
+ promoter_id as 'promoterId',
|
|
|
+ promoter_nick_name as 'promoterNickName',
|
|
|
+ count(oid) as 'orderNum',
|
|
|
+ sum(case when order_status != 80 then 1 else 0 end) as 'validOrderNUm',
|
|
|
+ round(sum(case when order_status != 80 then 1 else 0 end) / count(oid) * 100,2) as 'validRadio',
|
|
|
+ sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) as 'deliveryNum',
|
|
|
+ round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case when order_status != 80
|
|
|
+ then 1 else 0 end) * 100,2) as 'deliveryRadio'
|
|
|
+ from kuaishou_supply_chain
|
|
|
+ where 1= 1
|
|
|
+ <if test="start != null and start != ''">
|
|
|
+ and order_create_time >= #{start}
|
|
|
+ </if>
|
|
|
+ <if test="end != null and end != ''">
|
|
|
+ and order_create_time <= #{end}
|
|
|
+ </if>
|
|
|
+ <if test="promoterId != null and promoterId != ''">
|
|
|
+ and promoter_id = #{promoterId}
|
|
|
+ </if>
|
|
|
+ <if test="promoterNickName != null and promoterNickName != ''">
|
|
|
+ and promoter_nick_name like concat(concat('%',#{promoterNickName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="itemId != null and itemId != ''">
|
|
|
+ and item_id = #{itemId}
|
|
|
+ </if>
|
|
|
+ <if test="itemTitle != null and itemTitle != ''">
|
|
|
+ and item_title like concat(concat('%',#{itemTitle}),'%')
|
|
|
+ </if>
|
|
|
+ group by item_id,promoter_id) t
|
|
|
+ order by t.itemId,t.orderNum desc
|
|
|
+ </select>
|
|
|
</mapper>
|