Ver código fonte

1.跟单金额统计bug调整2.0

wuhp 2 anos atrás
pai
commit
c7c7da6ce5

+ 5 - 1
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -839,7 +839,11 @@
         MAX( a.company_name ) AS "companyName",
         MAX( a.company_id ) AS "companyId",
         MAX( a.partner_companies_name ) AS "partnerCompaniesName",
-        IFNULL ( max(d.settleMentAmount),0.00)-IFNULL(max(f.settleMentAmount) , 0.00)  + IFNULL ( max(d.settleMentAmount),0.00)  as  "allInvoicCommissionFeevalue",
+        CASE
+        WHEN (IFNULL(MAX(d.settleMentAmount), 0.00) - IFNULL(MAX(f.settleMentAmount), 0.00)) = 0.00
+        THEN   IFNULL ( MAX(d.settleMentAmount) ,0.00)
+        ELSE (IFNULL(MAX(d.settleMentAmount), 0.00) - IFNULL(MAX(f.settleMentAmount), 0.00))
+        END AS "allInvoicCommissionFeevalue",
         IFNULL(max(f.settleMentAmount) , 0.00)  as  "readyCommissionFeevalue",
         IFNULL ( max(d.settleMentAmount),0.00)-IFNULL(max(f.settleMentAmount) , 0.00)  as "invoicCommissionFeevalue",
         sum(COALESCE( a.other_feevalue,0.00) )-IFNULL ( max(d.settleMentAmount),0.00)  as "noInvoicCommissionFeevalue",