Selaa lähdekoodia

[update] 日统计司机补货数错误问题修复

miajio 2 viikkoa sitten
vanhempi
commit
47cd1c0276

+ 9 - 3
warehouse-admin-data/src/main/resources/mapper/statistics/BillingQuantityStatisticsMapper.xml

@@ -74,13 +74,18 @@
     </select>
 
     <select id="queryDriverReplenishNum" resultType="com.yr.warehouse.admin.replenish.vo.DriverGoodsOrderNumVo">
-        select IFNULL(oas.id, roi.area_staff_id) as areaStaffId, rod.goods_id as goodsId, sum(rod.real_picking_number) as totalNum
+        select IFNULL(oas.id, roi.area_staff_id) as areaStaffId,
+               rod.goods_id                      as goodsId,
+               sum(rod.real_picking_number)      as totalNum
         from yr_replenish_order_detail as rod
                  left join yr_replenish_order_info as roi on rod.order_number = roi.order_number
-        left join yr_operators_area_staff as oas on roi.replenish_user_id = oas.accountId
+                 left join (select id, accountId
+                            from yr_operators_area_staff
+                            where isDelete = 'NORMAL'
+                            group by accountId) as oas on roi.replenish_user_id = oas.accountId
         where roi.replenish_time between #{beginTime} and #{endTime}
           and roi.replenish_status = 2
-        group by roi.area_staff_id, rod.goods_id
+        group by oas.id, rod.goods_id
     </select>
 
     <select id="queryDeviceReplenishNum" resultType="com.yr.warehouse.admin.replenish.vo.DriverGoodsOrderNumVo">
@@ -99,6 +104,7 @@
                  left join yr_warehouse_back_order_info as wboi on wbod.backOrderId = wboi.id
                  left join (select id, accountId
                             from yr_operators_area_staff
+                            where isDelete = 'NORMAL'
                             group by accountId) as oas on oas.accountId = wboi.replenishId
         where wboi.backTime between #{beginTime} and #{endTime}
           and wboi.backStatus = 'BACK_SUCCESS'