| | |
| | | </select> |
| | | |
| | | <select id="selectSupplierDoList4Check" resultType="com.mzl.flower.dto.response.payment.DeliveryOrderList4CheckDTO"> |
| | | SELECT tt.id, tt.supplierName, tt.supplierTel, tt.stationName, sum(tt.num) totalNum, sum(tt.amount) totalAmount |
| | | SELECT tt.id, tt.supplierName, tt.supplierTel, tt.stationName, sum(tt.num) totalNum |
| | | , sum(tt.amount) totalAmount, sum(tt.uncheckedCount) uncheckedCount |
| | | from ( |
| | | select s.id, s.name supplierName, s.contact_tel supplierTel, st.name stationName |
| | | , (select sum(num) from t_order_item oi |
| | | where oi.supplier_id = q.supplier_id and oi.order_id = q.order_id) num |
| | | , (select sum(oi.supplier_price * oi.num) from t_order_item oi |
| | | , (select sum(oi.supplier_price * oi.num) from t_order_item oi |
| | | where oi.supplier_id = q.supplier_id and oi.order_id = q.order_id) amount |
| | | , (select count(1) from t_delivery_order dor |
| | | where dor.id = q.id and dor.status != 'CHECKED') uncheckedCount |
| | | from t_supplier_info s |
| | | join t_station st on st.id = s.station_id |
| | | join t_delivery_order q on s.id = q.supplier_id |