|
|
@@ -74,7 +74,8 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="queryDriverReplenishNum" resultType="com.yr.warehouse.admin.replenish.vo.DriverGoodsOrderNumVo">
|
|
|
- select IFNULL(oas.id, roi.area_staff_id) as areaStaffId,
|
|
|
+ select
|
|
|
+ IF(roi.replenish_user_id != roi.replenish_account_id, IFNULL(oas.id, roi.area_staff_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
|
|
|
@@ -89,9 +90,15 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="queryDeviceReplenishNum" resultType="com.yr.warehouse.admin.replenish.vo.DriverGoodsOrderNumVo">
|
|
|
- select roi.area_staff_id as areaStaffId, sum(rod.real_picking_number) as totalNum
|
|
|
+ select
|
|
|
+ IF(roi.replenish_user_id != roi.replenish_account_id, IFNULL(oas.id, roi.area_staff_id), roi.area_staff_id) as areaStaffId,
|
|
|
+ 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 (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
|
|
|
and rod.real_picking_number > 0
|