join logpm_distribution_reservation ldr on lds.reservation_id =ldr.id
join logpm_distribution_reservation ldr on lds.reservation_id =ldr.id
WHERE lds.delivery_id = lddl.id) inventoryNub,
WHERE lds.delivery_id = lddl.id) inventoryNub,
(SELECT COALESCE(sum(lds.loaded_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
FROM
FROM
logpm_distribution_delivery_list lddl
logpm_distribution_delivery_list lddl
@ -610,9 +611,10 @@
<iftest="param.createTime_query!=null and param.createTime_query!=''">
<iftest="param.createTime_query!=null and param.createTime_query!=''">
and date_format(lddl.create_time,'%y%m%d%') = date_format(#{param.createTime_query},'%y%m%d%')
and date_format(lddl.create_time,'%y%m%d%') = date_format(#{param.createTime_query},'%y%m%d%')
</if>
</if>
<iftest="param.taskTime!=null and param.taskTime!=''">
<iftest="param.taskTime_start!=null and param.taskTime_start!=''">
and date_format(lddl.task_time,'%y%m%d%') = date_format(#{param.taskTime},'%y%m%d%')
and date_format(lddl.task_time,'%y%m%d%') >= date_format(#{param.taskTime_start},'%y%m%d%') and date_format(lddl.task_time,'%y%m%d%') <= date_format(#{param.taskTime_end},'%y%m%d%')
join logpm_distribution_reservation ldr on ldr.id = lds.reservation_id
WHERE
lds.received_quantity >= ldr.reservation_num and lds.receivedin_quantity >= ldr.reservation_stock_list_num and lds.is_deleted = 0 and lds.delivery_id =#{id}
(SELECT COALESCE(COUNT(*), 0) from logpm_distribution_loadscan ldl WHERE ldl.order_id =ldsa.id and ldl.scan_status !=1 and ldl.signfor_state =2 ) signNub
FROM
logpm_distribution_signfor lds join
logpm_distribution_reservation ldr on lds.reservation_id = ldr.id
join logpm_distribution_reservation_stockarticle ldrs on ldr.id = ldrs.reservation_id
join logpm_distribution_stock_article ldsa on ldsa.id =ldr.stock_article_id
(SELECT COALESCE(COUNT(*), 0) from logpm_distribution_loadscan ldl WHERE ldl.order_id =ldsa.id and ldl.scan_status !=1 and ldl.signfor_state =2) signforNub
FROM
logpm_distribution_reservation ldr
join logpm_distribution_reservation_stockarticle ldrs on ldr.id = ldrs.reservation_id
join logpm_distribution_stock_article ldsa on ldsa.id =ldrs.stock_article_id
<where>
ldr.is_deleted = 0
<iftest="param.state != null and param.state!=''">
and ldsa.state = #{param.state}
</if>
<iftest="param.orderSelfNumbering != null and param.orderSelfNumbering!=''">
and ldsa.order_self_numbering = #{param.orderSelfNumbering}
-- join logpm_distribution_reservation ldr on lds.reservation_id =ldr.id
-- WHERE lds.delivery_id = lddl.id) inventoryNub,
(SELECT COALESCE(sum(lds.receivedin_quantity+lds.received_quantity), 0) FROM logpm_distribution_signfor lds WHERE
lddl.id = lds.delivery_id) signNub,
( (SELECT COALESCE(count(*), 0) FROM logpm_distribution_loadscan ldl WHERE
lddl.id = ldl.delivery_id and ldl.signfor_state =2) +
(SELECT COALESCE(count(*), 0) FROM logpm_distribution_loadscaninvn ldl WHERE
lddl.id = ldl.delivery_id and ldl.signfor_state =2) ) signNubSr
FROM
logpm_distribution_delivery_list lddl
left join logpm_distribution_delivery_self ldds on lddl.id =ldds.delivery_id
<where>
lddl.is_deleted =0
<iftest="param.createTime_query!=null and param.createTime_query!=''">
and date_format(lddl.create_time,'%y%m%d%') = date_format(#{param.createTime_query},'%y%m%d%')
</if>
<iftest="param.taskTime_start!=null and param.taskTime_start!=''">
and date_format(lddl.task_time,'%y%m%d%') >= date_format(#{param.taskTime_start},'%y%m%d%') and date_format(lddl.task_time,'%y%m%d%') <= date_format(#{param.taskTime_end},'%y%m%d%')