|
@@ -316,9 +316,14 @@
|
|
<if test="promoterNickName != null and promoterNickName != ''">
|
|
<if test="promoterNickName != null and promoterNickName != ''">
|
|
and promoter_nick_name like concat(concat('%',#{promoterNickName}),'%')
|
|
and promoter_nick_name like concat(concat('%',#{promoterNickName}),'%')
|
|
</if>
|
|
</if>
|
|
- group by promoter_id) t left join (select promoter_id,group_concat(user_name) as 'userName' from
|
|
|
|
|
|
+ group by promoter_id) t left join (select promoter_id,group_concat(user_name) as 'userName',user_id as 'userId'
|
|
|
|
+ from
|
|
kuaishou_promoter group by promoter_id) tt
|
|
kuaishou_promoter group by promoter_id) tt
|
|
on t.promoterId = tt.promoter_id
|
|
on t.promoterId = tt.promoter_id
|
|
|
|
+ where 1 =1
|
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
|
+ and tt.userId = #{userId}
|
|
|
|
+ </if>
|
|
order by t.orderNum desc
|
|
order by t.orderNum desc
|
|
</select>
|
|
</select>
|
|
<select id="itemServiceCharge" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="itemServiceCharge" resultType="com.alibaba.fastjson.JSONObject">
|
|
@@ -890,18 +895,21 @@
|
|
|
|
|
|
</select>
|
|
</select>
|
|
<select id="getSupplyChainUserList" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="getSupplyChainUserList" resultType="com.alibaba.fastjson.JSONObject">
|
|
- select t3.user_id as 'userId', t3.nick_name as 'nickMame', t1.role_name as 'roleName', t3.status
|
|
|
|
- from sys_role t1
|
|
|
|
- left join sys_user_role t2 on t1.role_id = t2.role_id
|
|
|
|
- left join sys_user t3 on t2.user_id = t3.user_id
|
|
|
|
- where t1.role_key in (
|
|
|
|
- 'association',
|
|
|
|
- 'associationManager',
|
|
|
|
- 'bd',
|
|
|
|
- 'bdManager'
|
|
|
|
- )
|
|
|
|
- group by t3.user_id
|
|
|
|
- order by t3.create_time asc
|
|
|
|
|
|
+ select *
|
|
|
|
+ from (select t3.user_id as 'userId', t3.nick_name as 'nickMame', t1.role_name as 'roleName', t3.status,
|
|
|
|
+ t3.create_time
|
|
|
|
+ from sys_role t1
|
|
|
|
+ left join sys_user_role t2 on t1.role_id = t2.role_id
|
|
|
|
+ left join sys_user t3 on t2.user_id = t3.user_id
|
|
|
|
+ where t1.role_key in (
|
|
|
|
+ 'association',
|
|
|
|
+ 'associationManager',
|
|
|
|
+ 'bd',
|
|
|
|
+ 'bdManager'
|
|
|
|
+ )
|
|
|
|
+ group by t3.user_id) t
|
|
|
|
+ where t.userId is not null
|
|
|
|
+ order by t.create_time desc
|
|
</select>
|
|
</select>
|
|
<select id="adminReportList" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="adminReportList" resultType="com.alibaba.fastjson.JSONObject">
|
|
select *
|
|
select *
|
|
@@ -928,7 +936,11 @@
|
|
when t2.order_status != 80 then t2.regimental_promotion_amount
|
|
when t2.order_status != 80 then t2.regimental_promotion_amount
|
|
else 0 end) as 'regimentalPromotionAmount',
|
|
else 0 end) as 'regimentalPromotionAmount',
|
|
sum(case when t2.order_status != 80 then t2.total_regimental_settle_amount else 0 end) as
|
|
sum(case when t2.order_status != 80 then t2.total_regimental_settle_amount else 0 end) as
|
|
- 'totalRegimentalSettleAmount'
|
|
|
|
|
|
+ 'totalRegimentalSettleAmount',
|
|
|
|
+ round( sum(case
|
|
|
|
+ when t2.order_status != 80 then t2.regimental_promotion_amount
|
|
|
|
+ else 0 end) / sum(case when t2.order_status != 80 then t2.pay_amount else 0 end) ,5 ) as 'avgServiceRate'
|
|
|
|
+
|
|
from kuaishou_item_bind_user t1
|
|
from kuaishou_item_bind_user t1
|
|
left join kuaishou_supply_chain t2
|
|
left join kuaishou_supply_chain t2
|
|
on t1.item_id = t2.item_id
|
|
on t1.item_id = t2.item_id
|
|
@@ -2089,7 +2101,10 @@
|
|
when t2.order_status != 80 then t2.regimental_promotion_amount
|
|
when t2.order_status != 80 then t2.regimental_promotion_amount
|
|
else 0 end) / 100, 2 )as 'regimentalPromotionAmount',
|
|
else 0 end) / 100, 2 )as 'regimentalPromotionAmount',
|
|
round(sum(case when t2.order_status != 80 then t2.total_regimental_settle_amount else 0 end) / 100 , 2) as
|
|
round(sum(case when t2.order_status != 80 then t2.total_regimental_settle_amount else 0 end) / 100 , 2) as
|
|
- 'totalRegimentalSettleAmount'
|
|
|
|
|
|
+ 'totalRegimentalSettleAmount',
|
|
|
|
+ round( sum(case
|
|
|
|
+ when t2.order_status != 80 then t2.regimental_promotion_amount
|
|
|
|
+ else 0 end) / sum(case when t2.order_status != 80 then t2.pay_amount else 0 end) * 100 ,2) as 'avgServiceRate'
|
|
from kuaishou_item_bind_user t1
|
|
from kuaishou_item_bind_user t1
|
|
left join kuaishou_supply_chain t2
|
|
left join kuaishou_supply_chain t2
|
|
on t1.item_id = t2.item_id
|
|
on t1.item_id = t2.item_id
|
|
@@ -2149,7 +2164,10 @@
|
|
when t2.order_status != 80 then t2.regimental_promotion_amount
|
|
when t2.order_status != 80 then t2.regimental_promotion_amount
|
|
else 0 end) as 'regimentalPromotionAmount',
|
|
else 0 end) as 'regimentalPromotionAmount',
|
|
sum(case when t2.order_status != 80 then t2.total_regimental_settle_amount else 0 end) as
|
|
sum(case when t2.order_status != 80 then t2.total_regimental_settle_amount else 0 end) as
|
|
- 'totalRegimentalSettleAmount'
|
|
|
|
|
|
+ 'totalRegimentalSettleAmount',
|
|
|
|
+ round( sum(case
|
|
|
|
+ when t2.order_status != 80 then t2.regimental_promotion_amount
|
|
|
|
+ else 0 end) / sum(case when t2.order_status != 80 then t2.pay_amount else 0 end) ,5) as 'avgServiceRate'
|
|
from kuaishou_item_list t1
|
|
from kuaishou_item_list t1
|
|
left join (select item_id,
|
|
left join (select item_id,
|
|
oid,
|
|
oid,
|
|
@@ -2197,7 +2215,10 @@
|
|
when t2.order_status != 80 then t2.regimental_promotion_amount
|
|
when t2.order_status != 80 then t2.regimental_promotion_amount
|
|
else 0 end) / 100, 2 )as 'regimentalPromotionAmount',
|
|
else 0 end) / 100, 2 )as 'regimentalPromotionAmount',
|
|
round(sum(case when t2.order_status != 80 then t2.total_regimental_settle_amount else 0 end) / 100 , 2) as
|
|
round(sum(case when t2.order_status != 80 then t2.total_regimental_settle_amount else 0 end) / 100 , 2) as
|
|
- 'totalRegimentalSettleAmount'
|
|
|
|
|
|
+ 'totalRegimentalSettleAmount',
|
|
|
|
+ round( sum(case
|
|
|
|
+ when t2.order_status != 80 then t2.regimental_promotion_amount
|
|
|
|
+ else 0 end) / sum(case when t2.order_status != 80 then t2.pay_amount else 0 end) * 100 ,2) as 'avgServiceRate'
|
|
from kuaishou_item_list t1
|
|
from kuaishou_item_list t1
|
|
left join (select item_id,
|
|
left join (select item_id,
|
|
oid,
|
|
oid,
|