瀏覽代碼

解决首页左上角查询柜数区分车队

阿伏兔 4 年之前
父節點
當前提交
a2be0129e7
共有 1 個文件被更改,包括 11 次插入5 次删除
  1. 11 5
      ruoyi-fleet/src/main/resources/mapper/orderPlan/ftmsorderbillscarsMapper.xml

+ 11 - 5
ruoyi-fleet/src/main/resources/mapper/orderPlan/ftmsorderbillscarsMapper.xml

@@ -693,12 +693,18 @@
 
     <select id="selectHomeUpperLeftCntrs" parameterType="ftmsorderbills" resultType="Map">
         SELECT
-            IFNULL(SUM( cntr_qty ), 0) planQuantity, IFNULL(SUM( cntr_blc_qty ), 0) surplusQuantity
+            IFNULL( SUM( p.cntr_qty ), 0 ) planQuantity,
+            IFNULL( SUM( ( p.cntr_qty - p.car_qty ) ), 0 ) surplusQuantity
         FROM
-            F_TMSORDERBILLSCNTRS
-        where
-            create_time &gt;= #{currentDay[0]}
-            and create_time &lt;= #{currentDay[1]}
+            F_TMSORDERBILLSPLANS p
+            LEFT JOIN t_corps fleet ON fleet.f_id = p.carcor_pid
+        WHERE
+            p.create_time &gt;= #{currentDay[0]}
+            AND p.create_time &lt;= #{currentDay[1]}
+            AND p.bill_status = 6
+            <if test="isFleet != null and isFleet == 1">
+                AND fleet.f_id = #{fleetId}
+            </if>
     </select>
 
     <select id="selectHomeUpperLeftCars" parameterType="ftmsorderbills" resultType="int">