|
|
@@ -512,7 +512,12 @@
|
|
|
inner join dkic_b.t_mst_goods_sku tmgs on t.sku_id = tmgs.sku_id
|
|
|
left join(select from_item_id,sum(item_qty) as sumQty from t_psi_purchase_item
|
|
|
group by from_item_id) as pi on pi.from_item_id = t.item_id
|
|
|
- <include refid="Condition_pur"/>
|
|
|
+ <where>
|
|
|
+ t.item_qty - coalesce(sumQty,0) > 0
|
|
|
+ <if test="orderNo != null">
|
|
|
+ AND tpo.order_no like concat('%', my_ex.likequery(#{orderNo}) , '%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
order by t.item_id
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
|
@@ -525,7 +530,14 @@
|
|
|
FROM dkic_b.t_psi_order_item as t
|
|
|
left join dkic_b.t_psi_order as tpo on tpo.order_id = t.order_id
|
|
|
inner join dkic_b.t_mst_goods_sku tmgs on t.sku_id = tmgs.sku_id
|
|
|
- <include refid="Condition_pur"/>
|
|
|
+ left join(select from_item_id,sum(item_qty) as sumQty from t_psi_purchase_item
|
|
|
+ group by from_item_id) as pi on pi.from_item_id = t.item_id
|
|
|
+ <where>
|
|
|
+ t.item_qty - coalesce(sumQty,0) > 0
|
|
|
+ <if test="orderNo != null">
|
|
|
+ AND tpo.order_no like concat('%', my_ex.likequery(#{orderNo}) , '%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
|
</if>
|