| | |
| | | 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 |
| | |
| | | and t.order_no like concat('%', #{dto.orderNo}, '%') |
| | | </if> |
| | | <if test="dto.createStartDate!=null "> |
| | | AND DATE_FORMAT(w.create_time, '%Y-%m-%d') >= #{dto.createStartDate} |
| | | AND DATE_FORMAT(t.create_time, '%Y-%m-%d') >= #{dto.createStartDate} |
| | | </if> |
| | | <if test="dto.endEndDate!=null "> |
| | | AND DATE_FORMAT(w.create_time, '%Y-%m-%d') <= #{dto.endEndDate} |
| | | AND DATE_FORMAT(t.create_time, '%Y-%m-%d') <= #{dto.endEndDate} |
| | | </if> |
| | | <if test="dto.approveStartDate!=null "> |
| | | AND DATE_FORMAT(w.approve_time, '%Y-%m-%d') >= #{dto.approveStartDate} |
| | |
| | | and t.order_no like concat('%', #{dto.orderNo}, '%') |
| | | </if> |
| | | <if test="dto.createStartDate!=null "> |
| | | AND DATE_FORMAT(w.create_time, '%Y-%m-%d') >= #{dto.createStartDate} |
| | | AND DATE_FORMAT(t.create_time, '%Y-%m-%d') >= #{dto.createStartDate} |
| | | </if> |
| | | <if test="dto.endEndDate!=null "> |
| | | AND DATE_FORMAT(w.create_time, '%Y-%m-%d') <= #{dto.endEndDate} |
| | | AND DATE_FORMAT(t.create_time, '%Y-%m-%d') <= #{dto.endEndDate} |
| | | </if> |
| | | <if test="dto.approveStartDate!=null "> |
| | | AND DATE_FORMAT(w.approve_time, '%Y-%m-%d') >= #{dto.approveStartDate} |