| | |
| | | sum(order_replace_fee) as order_replace_fee, |
| | | sum(order_fee_supplier) as order_fee_supplier, |
| | | sum(order_fee_partner) as order_fee_partner, |
| | | sum(order_fee_platform) + sum(order_fee_packing_transport) as order_fee_platform, |
| | | sum(order_fee_platform) as order_fee_platform, |
| | | sum(order_fee_platform_pack) as order_fee_platform_pack, |
| | | sum(order_fee_platform_check) as order_fee_platform_check, |
| | | sum(order_fee_platform_transport) as order_fee_platform_transport, |
| | |
| | | o.create_time as orderDate, |
| | | o.payment_time, |
| | | o.status_backend as settleStatus, |
| | | vor.order_num as order_num, |
| | | vor.order_num-vor.order_lack_num as real_sale_num, |
| | | vor.* |
| | | from t_order o |
| | |
| | | select t2.*, |
| | | IFNULL(t3.fee_supplier,0) as order_fee_supplier, |
| | | IFNULL(t3.fee_partner,0) as order_fee_partner, |
| | | IFNULL(t3.fee_platform,0) as order_fee_platform, |
| | | IFNULL(t3.fee_platform,0) + IFNULL(t3.fee_packing_transport,0) as order_fee_platform, |
| | | IFNULL(t3.fee_platform_pack,0) as order_fee_platform_pack, |
| | | IFNULL(t3.fee_platform_check,0) as order_fee_platform_check, |
| | | IFNULL(t3.fee_platform_transport,0) as order_fee_platform_transport, |
| | |
| | | IFNULL(t3.fee_packing_transport,0) as order_fee_packing_transport |
| | | from ( |
| | | select |
| | | t1.order_id, t1.total_amount ,sum(t1.num) as order_num , (t1.flower_amount + t1.packing_fee + t1.transport_fee) as order_total, sum(t1.supplier_price_amount) as order_supplier_price_amount, sum(t1.markup_one_amount) as order_markup_one_amount,sum(t1.markup_two_amount) as order_markup_two_amount, sum(t1.markup_partner_amount) as order_markup_partner_amount,sum(t1.price_amount) as order_price_amount,sum(t1.original_price_amount) as order_original_price_amount,sum(t1.price_discount_amount) as order_price_discount_amount,sum(t1.coupon_amount_total) as order_coupon_amount_total,sum(t1.check_fee) as order_check_fee,sum(t1.lack_fee_supplier) as order_lack_fee_supplier,sum(t1.replace_fee) as order_replace_fee, |
| | | t1.order_id, t1.total_amount ,sum(t1.num) as order_num , |
| | | ( sum( t1.supplier_price_amount )+sum( t1.markup_one_amount )+sum( t1.markup_two_amount )+sum( t1.markup_partner_amount ) + t1.packing_fee + t1.transport_fee ) AS order_total, |
| | | sum(t1.supplier_price_amount) as order_supplier_price_amount, sum(t1.markup_one_amount) as order_markup_one_amount,sum(t1.markup_two_amount) as order_markup_two_amount, sum(t1.markup_partner_amount) as order_markup_partner_amount,sum(t1.price_amount) as order_price_amount,sum(t1.original_price_amount) as order_original_price_amount,sum(t1.price_discount_amount) as order_price_discount_amount,sum(t1.coupon_amount_total) as order_coupon_amount_total,sum(t1.check_fee) as order_check_fee,sum(t1.lack_fee_supplier) as order_lack_fee_supplier,sum(t1.replace_fee) as order_replace_fee, |
| | | sum(replace_num) as order_replace_num,sum(reduce_num) as order_reduce_num,sum(lack_num) as order_lack_num |
| | | from ( |
| | | SELECT |
| | |
| | | sum(order_num)-sum(order_lack_num) as real_sale_num, |
| | | sum(sales_fee_supplier) sales_fee_supplier, |
| | | sum(order_supplier_price_amount) - sum(order_check_fee) - sum(order_replace_fee) - sum(order_lack_fee_supplier) - sum(sales_fee_supplier) profitFeeAmount, |
| | | case when COUNT(CASE WHEN status_backend IS NULL THEN 1 ELSE NULL END) = 0 Then '已完成' Else '进行中' end as settleStatus |
| | | case when COUNT(CASE WHEN status_backend ='COMPLETED' THEN NULL ELSE 1 END) = 0 Then '已完成' Else '进行中' end as settleStatus |
| | | from( |
| | | SELECT |
| | | oi.id,vor.*,p.name as supplierName,o.status_backend |
| | |
| | | sum(order_num)-sum(order_lack_num) as real_sale_num, |
| | | sum(sales_fee_supplier) sales_fee_supplier, |
| | | sum(order_supplier_price_amount) - sum(order_check_fee) - sum(order_replace_fee) - sum(order_lack_fee_supplier) - sum(sales_fee_supplier) profitFeeAmount, |
| | | case when COUNT(CASE WHEN status_backend IS NULL THEN 1 ELSE NULL END) = 0 Then '已完成' Else '进行中' end as settleStatus |
| | | case when COUNT(CASE WHEN status_backend ='COMPLETED' THEN NULL ELSE 1 END) = 0 Then '已完成' Else '进行中' end as settleStatus |
| | | from( |
| | | SELECT |
| | | oi.id,vor.*,p.name as supplierName,o.status_backend |
| | |
| | | |
| | | <!--供应商总价款--> |
| | | <sql id="all_supplier_amount"> |
| | | select IFNULL(sum(oi.supplier_price*oi.num),0) as supplier_amount from t_order_item oi where oi.supplier_id=287 |
| | | select IFNULL(sum(oi.supplier_price*oi.num),0) as supplier_amount |
| | | from t_order_item oi |
| | | left join t_order o |
| | | on oi.order_id = o.id |
| | | where o.deleted=0 |
| | | and o.status_backend not in ('PENDING','CANCEL','REFUND') |
| | | and oi.supplier_id = #{dto.supplierId} |
| | | </sql> |
| | | <!--本月成交:本月售卖的底价合计--> |
| | | <sql id="cur_mon_supplier_amount"> |
| | |
| | | from t_order_item oi |
| | | left join t_order o |
| | | on oi.order_id = o.id |
| | | where oi.supplier_id = #{dto.supplierId} |
| | | where o.deleted=0 |
| | | and o.status_backend not in ('PENDING','CANCEL','REFUND') |
| | | and oi.supplier_id = #{dto.supplierId} |
| | | and o.payment_time > DATE_FORMAT(LAST_DAY(DATE_SUB(CURRENT_DATE(), INTERVAL 1 MONTH)), '%Y-%m-%d 17:00:00') |
| | | and o.payment_time <= DATE_FORMAT(LAST_DAY(CURRENT_DATE()), '%Y-%m-%d 17:00:00') |
| | | </sql> |
| | |
| | | from t_order_item oi |
| | | left join t_order o |
| | | on oi.order_id = o.id |
| | | where oi.supplier_id = #{dto.supplierId} |
| | | where o.deleted=0 |
| | | and o.status_backend not in ('PENDING','CANCEL','REFUND') |
| | | and oi.supplier_id = #{dto.supplierId} |
| | | and o.payment_time > DATE_FORMAT(LAST_DAY(DATE_SUB(CURRENT_DATE(), INTERVAL 2 MONTH)), '%Y-%m-%d 17:00:00') |
| | | and o.payment_time <= DATE_FORMAT(DATE_SUB(DATE_FORMAT(CURRENT_DATE(), '%Y-%m-01'), INTERVAL 1 DAY), '%Y-%m-%d 17:00:00') |
| | | </sql> |
| | |
| | | from t_order_item oi |
| | | left join t_order o |
| | | on oi.order_id = o.id |
| | | where oi.supplier_id = #{dto.supplierId} |
| | | where o.deleted=0 |
| | | and o.status_backend not in ('PENDING','CANCEL','REFUND') |
| | | and oi.supplier_id = #{dto.supplierId} |
| | | and o.payment_time > #{dto.startDateTime} |
| | | and o.payment_time <= #{dto.endDateTime} |
| | | </sql> |
| | |
| | | on oic.order_item_id=oi.ID |
| | | left join t_order o |
| | | on oi.order_id = o.id |
| | | where oi.supplier_id = #{dto.supplierId} |
| | | where o.deleted=0 |
| | | and o.status_backend not in ('PENDING','CANCEL','REFUND') |
| | | and oi.supplier_id = #{dto.supplierId} |
| | | and oic.type = 'lack' and oic.audit_status='AGREED' |
| | | and o.payment_time > DATE_FORMAT(LAST_DAY(DATE_SUB(CURRENT_DATE(), INTERVAL 1 MONTH)), '%Y-%m-%d 17:00:00') |
| | | and o.payment_time <= DATE_FORMAT(LAST_DAY(CURRENT_DATE()), '%Y-%m-%d 17:00:00') |
| | |
| | | on oic.order_item_id=oi.ID |
| | | left join t_order o |
| | | on oi.order_id = o.id |
| | | where oi.supplier_id = #{dto.supplierId} |
| | | where o.deleted=0 |
| | | and o.status_backend not in ('PENDING','CANCEL','REFUND') |
| | | and oi.supplier_id = #{dto.supplierId} |
| | | and oic.type = 'lack' and oic.audit_status='AGREED' |
| | | and o.payment_time > DATE_FORMAT(LAST_DAY(DATE_SUB(CURRENT_DATE(), INTERVAL 2 MONTH)), '%Y-%m-%d 17:00:00') |
| | | and o.payment_time <= DATE_FORMAT(DATE_SUB(DATE_FORMAT(CURRENT_DATE(), '%Y-%m-01'), INTERVAL 1 DAY), '%Y-%m-%d 17:00:00') |
| | |
| | | on oic.order_item_id=oi.ID |
| | | left join t_order o |
| | | on oi.order_id = o.id |
| | | where oi.supplier_id = #{dto.supplierId} |
| | | where o.deleted=0 |
| | | and o.status_backend not in ('PENDING','CANCEL','REFUND') |
| | | and oi.supplier_id = #{dto.supplierId} |
| | | and oic.type = 'reduce' and oic.audit_status='AGREED' |
| | | and o.payment_time > DATE_FORMAT(LAST_DAY(DATE_SUB(CURRENT_DATE(), INTERVAL 1 MONTH)), '%Y-%m-%d 17:00:00') |
| | | and o.payment_time <= DATE_FORMAT(LAST_DAY(CURRENT_DATE()), '%Y-%m-%d 17:00:00') |
| | |
| | | on oic.order_item_id=oi.ID |
| | | left join t_order o |
| | | on oi.order_id = o.id |
| | | where oi.supplier_id = #{dto.supplierId} |
| | | where o.deleted=0 |
| | | and o.status_backend not in ('PENDING','CANCEL','REFUND') |
| | | and oi.supplier_id = #{dto.supplierId} |
| | | and oic.type = 'reduce' and oic.audit_status='AGREED' |
| | | and o.payment_time > DATE_FORMAT(LAST_DAY(DATE_SUB(CURRENT_DATE(), INTERVAL 2 MONTH)), '%Y-%m-%d 17:00:00') |
| | | and o.payment_time <= DATE_FORMAT(DATE_SUB(DATE_FORMAT(CURRENT_DATE(), '%Y-%m-01'), INTERVAL 1 DAY), '%Y-%m-%d 17:00:00') |
| | |
| | | on oic.order_item_id=oi.ID |
| | | left join t_order o |
| | | on oi.order_id = o.id |
| | | where oi.supplier_id = #{dto.supplierId} |
| | | where o.deleted=0 |
| | | and o.status_backend not in ('PENDING','CANCEL','REFUND') |
| | | and oi.supplier_id = #{dto.supplierId} |
| | | and oic.type = 'replace' and oic.audit_status='AGREED' |
| | | and o.payment_time > DATE_FORMAT(LAST_DAY(DATE_SUB(CURRENT_DATE(), INTERVAL 1 MONTH)), '%Y-%m-%d 17:00:00') |
| | | and o.payment_time <= DATE_FORMAT(LAST_DAY(CURRENT_DATE()), '%Y-%m-%d 17:00:00') |
| | |
| | | on oic.order_item_id=oi.ID |
| | | left join t_order o |
| | | on oi.order_id = o.id |
| | | where oi.supplier_id = #{dto.supplierId} |
| | | where o.deleted=0 |
| | | and o.status_backend not in ('PENDING','CANCEL','REFUND') |
| | | and oi.supplier_id = #{dto.supplierId} |
| | | and oic.type = 'replace' and oic.audit_status='AGREED' |
| | | and o.payment_time > DATE_FORMAT(LAST_DAY(DATE_SUB(CURRENT_DATE(), INTERVAL 2 MONTH)), '%Y-%m-%d 17:00:00') |
| | | and o.payment_time <= DATE_FORMAT(DATE_SUB(DATE_FORMAT(CURRENT_DATE(), '%Y-%m-01'), INTERVAL 1 DAY), '%Y-%m-%d 17:00:00') |