| | |
| | | |
| | | <select id="selectSettlementListByTime" |
| | | resultType="com.mzl.flower.dto.response.payment.DeliveryOrderItemSettlementDTO"> |
| | | SELECT oi.id orderItemId, oi.flower_name, oi.flower_level, oi.num, oi.supplier_price price, s.`status` |
| | | SELECT oi.id orderItemId, oi.flower_name, oi.flower_level, oi.num, oi.supplier_price price |
| | | , ois.check_num, ois.check_fee, ois.replace_num, ois.replace_fee, ois.lack_num, ois.lack_fee_supplier lackFee |
| | | , ois.station_fee, ois.sales_fee_supplier salesFee, ois.service_fee_rate, ois.service_fee |
| | | , ois.income_supplier income, o.status_backend, o.create_time orderTime, o.receive_time, o.order_no |
| | | , (select count(1) from t_order_item_sales sa where sa.order_item_id = oi.id) salesNum |
| | | , (select s.`status` from t_order_settlement_detail sd, t_order_settlement s |
| | | where sd.order_item_id = oi.id |
| | | and sd.settlement_id = s.id and s.type = 'supplier') status |
| | | FROM t_delivery_order_item doi |
| | | join t_delivery_order q on q.id = doi.delivery_id |
| | | join t_order o on o.id = q.order_id |
| | | join t_order_item oi on oi.id = doi.order_item_id |
| | | left join t_order_item_settlement ois on ois.order_item_id = oi.id |
| | | left join t_order_settlement_detail sd on sd.order_item_id = oi.id |
| | | left join t_order_settlement s on sd.settlement_id = s.id |
| | | WHERE q.deleted = 0 and doi.deleted = 0 |
| | | and s.type = 'supplier' |
| | | and q.supplier_id = #{supplierId} |
| | | <if test="startDate != null"> |
| | | AND q.create_time > #{startDate} |