|
@@ -669,13 +669,10 @@
|
|
left join sys_user_role t2 on t1.role_id = t2.role_id
|
|
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
|
|
left join sys_user t3 on t2.user_id = t3.user_id
|
|
where t1.role_key in (
|
|
where t1.role_key in (
|
|
- 'supplyChainAdmin',
|
|
|
|
|
|
+ 'association',
|
|
'associationManager',
|
|
'associationManager',
|
|
'bd',
|
|
'bd',
|
|
- 'bdManager',
|
|
|
|
- 'association',
|
|
|
|
- 'courtshipManager',
|
|
|
|
- 'courtship'
|
|
|
|
|
|
+ 'bdManager'
|
|
)
|
|
)
|
|
group by t3.user_id
|
|
group by t3.user_id
|
|
order by t3.create_time asc
|
|
order by t3.create_time asc
|
|
@@ -1616,14 +1613,14 @@
|
|
count(distinct t2.item_id) as 'itemCount',
|
|
count(distinct t2.item_id) as 'itemCount',
|
|
count(t2.oid) as 'orderNum',
|
|
count(t2.oid) as 'orderNum',
|
|
sum(case when t2.order_status != 80 then 1 else 0 end) as 'validOrderNUm',
|
|
sum(case when t2.order_status != 80 then 1 else 0 end) as 'validOrderNUm',
|
|
- round(sum(case when t2.order_status != 80 then 1 else 0 end) / count(t2.oid),4) as 'validRadio',
|
|
|
|
|
|
+ round(sum(case when t2.order_status != 80 then 1 else 0 end) / count(t2.oid) * 100,2) as 'validRadio',
|
|
sum(case when t2.send_status = 1 and t2.order_status != 80 then 1 else 0 end) as 'deliveryNum',
|
|
sum(case when t2.send_status = 1 and t2.order_status != 80 then 1 else 0 end) as 'deliveryNum',
|
|
sum(case when t2.send_status = 0 and t2.order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
|
|
sum(case when t2.send_status = 0 and t2.order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
|
|
round(sum(case when t2.send_status = 1 and t2.order_status != 80 then 1 else 0 end) / sum(case
|
|
round(sum(case when t2.send_status = 1 and t2.order_status != 80 then 1 else 0 end) / sum(case
|
|
when t2.order_status != 80
|
|
when t2.order_status != 80
|
|
then 1
|
|
then 1
|
|
- else 0 end),
|
|
|
|
- 4) as 'deliveryRadio',
|
|
|
|
|
|
+ else 0 end) * 100,
|
|
|
|
+ 2) as 'deliveryRadio',
|
|
sum(case when t2.order_status = 80 then 1 else 0 end) as 'invalidOrderNUm',
|
|
sum(case when t2.order_status = 80 then 1 else 0 end) as 'invalidOrderNUm',
|
|
round(sum(case when t2.order_status != 80 then t2.pay_amount else 0 end) / 100 , 2) as 'payAmount',
|
|
round(sum(case when t2.order_status != 80 then t2.pay_amount else 0 end) / 100 , 2) as 'payAmount',
|
|
round(sum(case
|
|
round(sum(case
|
|
@@ -1654,4 +1651,105 @@
|
|
</if>
|
|
</if>
|
|
order by t.orderNum desc
|
|
order by t.orderNum desc
|
|
</select>
|
|
</select>
|
|
|
|
+ <select id="getSupplyChainCourtshipUserList" 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 (
|
|
|
|
+ 'courtship',
|
|
|
|
+ 'courtshipManager'
|
|
|
|
+ )
|
|
|
|
+ group by t3.user_id
|
|
|
|
+ order by t3.create_time asc
|
|
|
|
+ </select>
|
|
|
|
+ <select id="adminReportListByBind" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
+ select * from (
|
|
|
|
+ select t1.user_id as 'userId',
|
|
|
|
+ t1.user_name as 'userName',
|
|
|
|
+ count(distinct t1.item_id) as 'itemCount',
|
|
|
|
+ count(t2.oid) as 'orderNum',
|
|
|
|
+ count(distinct t3.courier_number) as 'sendSampleCount',
|
|
|
|
+ sum(case when t2.order_status != 80 then 1 else 0 end) as 'validOrderNUm',
|
|
|
|
+ round(sum(case when t2.order_status != 80 then 1 else 0 end) / count(t2.oid), 4) as 'validRadio',
|
|
|
|
+ sum(case when t2.send_status = 1 and t2.order_status != 80 then 1 else 0 end) as 'deliveryNum',
|
|
|
|
+ sum(case when t2.send_status = 0 and t2.order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
|
|
|
|
+ round(sum(case when t2.send_status = 1 and t2.order_status != 80 then 1 else 0 end) / sum(case
|
|
|
|
+ when t2.order_status != 80
|
|
|
|
+ then 1
|
|
|
|
+ else 0 end),
|
|
|
|
+ 4) as 'deliveryRadio',
|
|
|
|
+ sum(case when t2.order_status = 80 then 1 else 0 end) as 'invalidOrderNUm',
|
|
|
|
+ sum(case when t2.order_status != 80 then t2.pay_amount else 0 end) as 'payAmount',
|
|
|
|
+ sum(case
|
|
|
|
+ when t2.order_status != 80 then t2.regimental_promotion_amount
|
|
|
|
+ else 0 end) as 'regimentalPromotionAmount',
|
|
|
|
+ sum(case when t2.order_status != 80 then t2.total_regimental_settle_amount else 0 end) as
|
|
|
|
+ 'totalRegimentalSettleAmount'
|
|
|
|
+ from kuaishou_item_list t1
|
|
|
|
+ left join (select item_id,
|
|
|
|
+ oid,
|
|
|
|
+ order_status,
|
|
|
|
+ send_status,
|
|
|
|
+ pay_amount,
|
|
|
|
+ regimental_promotion_amount,
|
|
|
|
+ total_regimental_settle_amount
|
|
|
|
+ from kuaishou_supply_chain
|
|
|
|
+ where order_create_time >= #{start}) t2
|
|
|
|
+ on t1.item_id = t2.item_id
|
|
|
|
+ left join (select item_id, courier_number
|
|
|
|
+ from kuaishou_item_collect_samples
|
|
|
|
+ where courier_number_time >= from_unixtime(#{start}/1000,'%Y-%m-%d %H:%i:%s')) t3 on t1.item_id = t3.item_id
|
|
|
|
+ where t1.create_time >= from_unixtime(#{start}/1000,'%Y-%m-%d %H:%i:%s')
|
|
|
|
+ and t1.create_time <= from_unixtime(#{end}/1000,'%Y-%m-%d %H:%i:%s')
|
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
|
+ and t1.userId = #{userId}
|
|
|
|
+ </if>
|
|
|
|
+ group by t1.user_id ) t order by t.orderNum desc
|
|
|
|
+ </select>
|
|
|
|
+ <select id="exportAdminReportListByBind" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
+ select * from (
|
|
|
|
+ select t1.user_id as 'userId',
|
|
|
|
+ t1.user_name as 'userName',
|
|
|
|
+ count(distinct t1.item_id) as 'itemCount',
|
|
|
|
+ count(t2.oid) as 'orderNum',
|
|
|
|
+ count(distinct t3.courier_number) as 'sendSampleCount',
|
|
|
|
+ sum(case when t2.order_status != 80 then 1 else 0 end) as 'validOrderNUm',
|
|
|
|
+ round(sum(case when t2.order_status != 80 then 1 else 0 end) / count(t2.oid) * 100,2) as 'validRadio',
|
|
|
|
+ sum(case when t2.send_status = 1 and t2.order_status != 80 then 1 else 0 end) as 'deliveryNum',
|
|
|
|
+ sum(case when t2.send_status = 0 and t2.order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
|
|
|
|
+ round(sum(case when t2.send_status = 1 and t2.order_status != 80 then 1 else 0 end) / sum(case
|
|
|
|
+ when t2.order_status != 80
|
|
|
|
+ then 1
|
|
|
|
+ else 0 end) * 100,
|
|
|
|
+ 2) as 'deliveryRadio',
|
|
|
|
+ sum(case when t2.order_status = 80 then 1 else 0 end) as 'invalidOrderNUm',
|
|
|
|
+ round(sum(case when t2.order_status != 80 then t2.pay_amount else 0 end) / 100 , 2) as 'payAmount',
|
|
|
|
+ round(sum(case
|
|
|
|
+ when t2.order_status != 80 then t2.regimental_promotion_amount
|
|
|
|
+ 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
|
|
|
|
+ 'totalRegimentalSettleAmount'
|
|
|
|
+ from kuaishou_item_list t1
|
|
|
|
+ left join (select item_id,
|
|
|
|
+ oid,
|
|
|
|
+ order_status,
|
|
|
|
+ send_status,
|
|
|
|
+ pay_amount,
|
|
|
|
+ regimental_promotion_amount,
|
|
|
|
+ total_regimental_settle_amount
|
|
|
|
+ from kuaishou_supply_chain
|
|
|
|
+ where order_create_time >= #{start}) t2
|
|
|
|
+ on t1.item_id = t2.item_id
|
|
|
|
+ left join (select item_id, courier_number
|
|
|
|
+ from kuaishou_item_collect_samples
|
|
|
|
+ where courier_number_time >= from_unixtime(#{start}/1000,'%Y-%m-%d %H:%i:%s')) t3 on t1.item_id = t3.item_id
|
|
|
|
+ where t1.create_time >= from_unixtime(#{start}/1000,'%Y-%m-%d %H:%i:%s')
|
|
|
|
+ and t1.create_time <= from_unixtime(#{end}/1000,'%Y-%m-%d %H:%i:%s')
|
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
|
+ and t1.userId = #{userId}
|
|
|
|
+ </if>
|
|
|
|
+ group by t1.user_id ) t order by t.orderNum desc
|
|
|
|
+
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|