Browse Source

修改备货数据查询

training
caoyizhong 1 year ago
parent
commit
fb46c1fc6b
  1. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml
  2. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml

14
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml

@ -315,11 +315,11 @@
ldr.consignee consignee, ldr.consignee consignee,
ldr.reservation_num reservationNum, ldr.reservation_num reservationNum,
COALESCE(lds.loaded_number + lds.loadedin_number, 0) loadingNub, COALESCE(lds.loaded_number + lds.loadedin_number, 0) loadingNub,
(SELECT COALESCE(COUNT(*), 0) from logpm_distribution_reservation_stockarticle ldrs WHERE ldrs.reservation_id =ldr.id ) ordNub, (SELECT COALESCE(COUNT(*), 0) from logpm_distribution_reservation_stockarticle ldrs WHERE ldrs.reservation_id =ldr.id and ldrs.stock_article_status in (1,3) ) ordNub,
COALESCE(lds.received_quantity + lds.receivedin_quantity, 0) signNub COALESCE(lds.received_quantity + lds.receivedin_quantity, 0) signNub
FROM FROM
logpm_distribution_signfor lds logpm_distribution_signfor lds
JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id and ldr.reservation_status != '40'
WHERE WHERE
lds.is_deleted = 0 lds.is_deleted = 0
AND lds.delivery_id = #{id} AND lds.delivery_id = #{id}
@ -337,12 +337,12 @@
lbm.logpm_unit logpmUnit lbm.logpm_unit logpmUnit
FROM FROM
logpm_distribution_reservation ldr logpm_distribution_reservation ldr
join logpm_distribution_reservation_stocklist ldrs on ldr.id = ldrs.reservation_id join logpm_distribution_reservation_stocklist ldrs on ldr.id = ldrs.reservation_id and ldrs.stock_article_status in (1,3)
join logpm_distribution_stock_list ldsl on ldsl.id = ldrs.stocklist_id join logpm_distribution_stock_list ldsl on ldsl.id = ldrs.stocklist_id
LEFT JOIN logpm_distribution_loadscaninvn ldl on ldsl.id = ldl.inventory_id LEFT JOIN logpm_distribution_loadscaninvn ldl on ldsl.id = ldl.inventory_id
left join logpm_basicdata_material lbm on ldsl.material_id = lbm.id left join logpm_basicdata_material lbm on ldsl.material_id = lbm.id
<where> <where>
ldr.is_deleted = 0 ldr.is_deleted = 0 and ldr.reservation_status != '40'
AND ldr.id = #{param.reservationId} AND ldr.id = #{param.reservationId}
</where> </where>
</select> </select>
@ -367,7 +367,7 @@
GROUP BY GROUP BY
ldsa.id ldsa.id
) AS loading ) AS loading
JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id and ldrs.stock_article_status in (1,3)
JOIN logpm_distribution_reservation ldr ON ldr.id = ldrs.reservation_id JOIN logpm_distribution_reservation ldr ON ldr.id = ldrs.reservation_id
JOIN logpm_distribution_stock_article ldsa ON ldsa.id = ldrs.stock_article_id JOIN logpm_distribution_stock_article ldsa ON ldsa.id = ldrs.stock_article_id
@ -406,7 +406,7 @@
GROUP BY GROUP BY
ldsa.id ldsa.id
) AS loading ) AS loading
JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id and ldrs.stock_article_status in (1,3)
JOIN logpm_distribution_reservation ldr ON ldr.id = ldrs.reservation_id JOIN logpm_distribution_reservation ldr ON ldr.id = ldrs.reservation_id
JOIN logpm_distribution_stock_article ldsa ON ldsa.id = ldrs.stock_article_id JOIN logpm_distribution_stock_article ldsa ON ldsa.id = ldrs.stock_article_id
<where> <where>
@ -442,7 +442,7 @@
GROUP BY GROUP BY
ldsa.id ldsa.id
) AS loading ) AS loading
JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id and ldrs.stock_article_status in (1,3)
JOIN logpm_distribution_reservation ldr ON ldr.id = ldrs.reservation_id JOIN logpm_distribution_reservation ldr ON ldr.id = ldrs.reservation_id
JOIN logpm_distribution_stock_article ldsa ON ldsa.id = ldrs.stock_article_id JOIN logpm_distribution_stock_article ldsa ON ldsa.id = ldrs.stock_article_id
<where> <where>

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml

@ -655,16 +655,15 @@
WHERE lds.delivery_id = lddl.id WHERE lds.delivery_id = lddl.id
) forkliftName, --> ) forkliftName, -->
lddl.create_time createTime, lddl.create_time createTime,
(SELECT COALESCE(COUNT(*), 0) FROM logpm_distribution_signfor lds WHERE lds.delivery_id =lddl.id) lddl.customers_number customersNumber,
customersNumber,
lddl.price price, lddl.price price,
lddl.added_services_id addedServicesId, lddl.added_services_id addedServicesId,
(SELECT COALESCE (COUNT(*) ,0) (SELECT COALESCE (COUNT(*) ,0)
FROM FROM
logpm_distribution_signfor lds logpm_distribution_signfor lds
join logpm_distribution_reservation ldr on lds.reservation_id =ldr.id join logpm_distribution_reservation ldr on lds.reservation_id =ldr.id and ldr.reservation_status != '40'
join logpm_distribution_reservation_stockarticle ldrs on ldrs.reservation_id =ldr.id join logpm_distribution_reservation_stockarticle ldrs on ldrs.reservation_id =ldr.id
WHERE lds.delivery_id = lddl.id WHERE lds.delivery_id = lddl.id and ldrs.stock_article_status in (1,3)
) orderNumber, ) orderNumber,
(SELECT COALESCE (sum(ldr.reservation_num + ldr.reservation_stock_list_num) ,0) (SELECT COALESCE (sum(ldr.reservation_num + ldr.reservation_stock_list_num) ,0)
FROM FROM
@ -689,7 +688,7 @@
(SELECT COALESCE (sum(ldr.reservation_stock_list_num) ,0) (SELECT COALESCE (sum(ldr.reservation_stock_list_num) ,0)
FROM FROM
logpm_distribution_signfor lds logpm_distribution_signfor lds
join logpm_distribution_reservation ldr on lds.reservation_id =ldr.id join logpm_distribution_reservation ldr on lds.reservation_id =ldr.id and ldr.reservation_status != '40'
WHERE lds.delivery_id = lddl.id) inventoryNub, WHERE lds.delivery_id = lddl.id) inventoryNub,
(SELECT COALESCE(sum(lds.loaded_number+lds.loadedin_number), 0) FROM logpm_distribution_signfor lds WHERE (SELECT COALESCE(sum(lds.loaded_number+lds.loadedin_number), 0) FROM logpm_distribution_signfor lds WHERE
lddl.id = lds.delivery_id) scannedNumber, lddl.id = lds.delivery_id) scannedNumber,
@ -699,7 +698,7 @@
where ldr.id in where ldr.id in
(select lds.reservation_id (select lds.reservation_id
from logpm_distribution_signfor lds from logpm_distribution_signfor lds
where lds.delivery_id = lddl.id ) where lds.delivery_id = lddl.id ) and ldr.reservation_status != '40'
) consignee ) consignee
FROM FROM
logpm_distribution_delivery_list lddl logpm_distribution_delivery_list lddl

Loading…
Cancel
Save