jeecg-boot/db/views/logistic_profit_analyze.sql

29 lines
2.1 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

CREATE OR REPLACE VIEW logistic_profit_analyze AS
SELECT c.internal_code AS '',
shopErpCode AS '',
lc.name AS '',
logisticChannelName AS '线',
platformOrderId AS '',
platformOrderNumber AS '',
orderTime AS '',
shippingTime AS '',
poled.country AS '',
fretFee AS '',
registration_fee AS '',
(fretFee * 7.6 - registration_fee) AS '',
shippingFee AS '',
realShippingFee AS '',
(shippingFee * 7.6 - realShippingFee) AS '',
vatFee AS '',
(vat + vat_service_fee) AS '',
(vatFee * 7.6 - vat - vat_service_fee) AS '',
serviceFee AS '',
serviceFee * 7.6 AS '',
(fretFee * 7.6 - registration_fee + shippingFee * 7.6 -
realShippingFee + vat * 7.6 - vat - vat_service_fee) AS ''
FROM platform_order_logistic_expense_detail poled
JOIN shop s
ON shop_id = s.id
JOIN CLIENT c ON s.owner_id = c.id
JOIN logistic_company lc ON poled.logistic_company_id = lc.id;