Browse Source

工作台新逻辑

czh 1 năm trước cách đây
mục cha
commit
2cae55094d

+ 7 - 18
sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderMapper.xml

@@ -2053,7 +2053,7 @@
 
     <select id="selectAcceptCarriageFinishOrder" resultType="com.sckw.transport.model.vo.StatisticsByOrderVO">
         SELECT IFNULL(SUM(t1.waitingAmount), 0) AS waitingAmount,
-        IFNULL(SUM(t1.amount), 0) AS amount,
+        count(1) AS amount,
         IFNULL(SUM(t1.entrustAmount), 0) AS entrustAmount,
         IFNULL(SUM(t1.subcontractAmount), 0) AS subcontractAmount,
         IFNULL(SUM(t1.totalPrice), 0) AS totalPrice
@@ -2061,13 +2061,7 @@
         (
         SELECT
         <!--        ( a.amount - IFNULL(a.total_load_amount,0)) AS waitingAmount,-->
-        case a.status
-        when
-        4 then 0
-        when 5 then 0
-        when 6 then 0
-        else (a.amount - IFNULL(a.total_load_amount, 0))
-        end waitingAmount,
+        CASE when a.STATUS in (0,1,2,3)  THEN 1 else 0 END waitingAmount,
         a.amount,
         a.entrust_amount AS entrustAmount,
         a.subcontract_amount AS subcontractAmount,
@@ -2098,18 +2092,13 @@
 
     <select id="selectStatisticsByOrder" resultType="com.sckw.transport.model.vo.StatisticsByOrderVO">
         SELECT IFNULL(SUM(t1.WaitingAmount), 0) AS WaitingAmount,
-        IFNULL(SUM(t1.amount), 0) AS amount,
+        count(1) AS amount,
         IFNULL(SUM(t1.entrustAmount), 0) AS entrustAmount,
         IFNULL(SUM(t1.subcontractAmount), 0) AS subcontractAmount,
         IFNULL(SUM(t1.totalPrice), 0) AS totalPrice
         FROM
         (
-        SELECT CASE
-        a.STATUS
-        WHEN 4 THEN
-        0
-        ELSE (a.amount - a.entrust_amount - a.subcontract_amount)
-        END waitingAmount,
+        SELECT CASE when a.STATUS in (0,1,2,3)  THEN 1 else 0 END waitingAmount,
         <!--        ( a.amount - a.entrust_amount - a.subcontract_amount ) AS WaitingAmount,-->
         a.amount,
         a.entrust_amount AS entrustAmount,
@@ -2141,14 +2130,14 @@
 
     <select id="selectAcceptCarriageAwaitFinishOrder" resultType="com.sckw.transport.model.vo.StatisticsByOrderVO">
         SELECT IFNULL(SUM(t1.WaitingAmount), 0)     AS WaitingAmount,
-               IFNULL(SUM(t1.amount), 0)            AS amount,
+               count(1)            AS amount,
                IFNULL(SUM(t1.entrustAmount), 0)     AS entrustAmount,
                IFNULL(SUM(t1.subcontractAmount), 0) AS subcontractAmount,
                IFNULL(SUM(t1.totalPrice), 0)        AS totalPrice
         FROM
         (
-        SELECT (a.amount - a.entrust_amount - a.subcontract_amount) AS WaitingAmount,
-               a.amount,
+        SELECT         CASE when a.STATUS in (0,1,2,3)  THEN 1 else 0 END waitingAmount,
+                a.amount,
                a.entrust_amount                                     AS entrustAmount,
                a.subcontract_amount                                 AS subcontractAmount,
                a.price,