Преглед на файлове

工作台统计查询修改-过滤已完成单据

lengfaqiang преди 2 години
родител
ревизия
436c83fd8b
променени са 1 файла, в които са добавени 15 реда и са изтрити 4 реда
  1. 15 4
      sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderMapper.xml

+ 15 - 4
sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderMapper.xml

@@ -1906,7 +1906,7 @@
 
     <select id="selectAcceptCarriageFinishOrder" resultType="com.sckw.transport.model.vo.StatisticsByOrderVO">
         SELECT
-        IFNULL( SUM( t1.WaitingAmount ), 0 ) AS WaitingAmount ,
+        IFNULL( SUM( t1.waitingAmount ), 0 ) AS waitingAmount ,
         IFNULL( SUM( t1.amount ), 0 ) AS amount ,
         IFNULL( SUM( t1.entrustAmount ), 0 ) AS entrustAmount ,
         IFNULL( SUM( t1.subcontractAmount ), 0 ) AS subcontractAmount ,
@@ -1914,7 +1914,13 @@
         FROM
         (
         SELECT
-        ( a.amount - IFNULL(a.total_load_amount,0)) AS WaitingAmount,
+<!--        ( 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,
         a.amount,
         a.entrust_amount AS entrustAmount,
         a.subcontract_amount AS subcontractAmount,
@@ -1955,7 +1961,12 @@
         FROM
         (
         SELECT
-        ( a.amount - a.entrust_amount - a.subcontract_amount ) AS WaitingAmount,
+        CASE
+        a.STATUS
+        WHEN 4 THEN
+        0 ELSE ( a.amount - a.entrust_amount - a.subcontract_amount )
+        END waitingAmount,
+<!--        ( a.amount - a.entrust_amount - a.subcontract_amount ) AS WaitingAmount,-->
         a.amount,
         a.entrust_amount AS entrustAmount,
         a.subcontract_amount AS subcontractAmount,
@@ -1971,7 +1982,7 @@
         <if test="topId != null and topId !=''">
             and b.top_ent_id = #{topId}
         </if>
-        <if test="statusList != null and statusList.size()>0">
+        <if test="statusList != null and statusList.size() > 0">
             and a.`status` IN
             <foreach collection="statusList" item="item" separator="," open="(" close=")">
                 #{item}