|
@@ -517,6 +517,8 @@
|
|
|
,tppi.item_qty as "purItemQty"
|
|
,tppi.item_qty as "purItemQty"
|
|
|
,tppi.intoing_qty as "purItemIntoingQty"
|
|
,tppi.intoing_qty as "purItemIntoingQty"
|
|
|
,tppi.into_qty as "purItemIntoQty"
|
|
,tppi.into_qty as "purItemIntoQty"
|
|
|
|
|
+ ,tmp.sup_code as "supCode"
|
|
|
|
|
+ ,tmp.sup_name as "supName"
|
|
|
,tpiv.inv_qty
|
|
,tpiv.inv_qty
|
|
|
FROM dkic_b.t_psi_inbound_item tpii
|
|
FROM dkic_b.t_psi_inbound_item tpii
|
|
|
left join dkic_b.t_psi_inbound tpid on tpii.into_id = tpid.into_id
|
|
left join dkic_b.t_psi_inbound tpid on tpii.into_id = tpid.into_id
|
|
@@ -527,20 +529,28 @@
|
|
|
left join dkic_b.t_mst_goods_brand tmgb on tmgb.brand_id = tmgs.brand_id
|
|
left join dkic_b.t_mst_goods_brand tmgb on tmgb.brand_id = tmgs.brand_id
|
|
|
left join dkic_b.t_psi_inventory tpi on tpi.inv_id = tpii.inv_id
|
|
left join dkic_b.t_psi_inventory tpi on tpi.inv_id = tpii.inv_id
|
|
|
left join dkic_b.t_mst_warehouse tmw on tmw.wh_id = tpii.wh_id
|
|
left join dkic_b.t_mst_warehouse tmw on tmw.wh_id = tpii.wh_id
|
|
|
|
|
+ Left join dkic_b.t_mst_supplier tmp on tpid.sup_id = tmp.sup_id
|
|
|
<where>
|
|
<where>
|
|
|
tpii.flg_valid
|
|
tpii.flg_valid
|
|
|
|
|
+ and tpii.into_qty <> 0
|
|
|
<if test="intoId != null and intoId != ''">
|
|
<if test="intoId != null and intoId != ''">
|
|
|
AND tpii.into_id = #{intoId}::uuid
|
|
AND tpii.into_id = #{intoId}::uuid
|
|
|
</if>
|
|
</if>
|
|
|
<if test="intoNo != null and intoNo != ''">
|
|
<if test="intoNo != null and intoNo != ''">
|
|
|
AND tpid.into_no LIKE concat('%',my_ex.likequery(#{intoNo}),'%')
|
|
AND tpid.into_no LIKE concat('%',my_ex.likequery(#{intoNo}),'%')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="intoDataStart != null">
|
|
|
|
|
- AND tpid.into_date >= #{intoDataStart}::timestamp with time zone
|
|
|
|
|
|
|
+ <if test="supId != null and supId != ''">
|
|
|
|
|
+ AND tpid.sup_id = #{supId}::uuid
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="intoDateStart != null">
|
|
|
|
|
+ AND tpid.into_date >= #{intoDateStart}::timestamp with time zone
|
|
|
</if>
|
|
</if>
|
|
|
<if test="intoDateEnd != null">
|
|
<if test="intoDateEnd != null">
|
|
|
AND tpid.into_date < #{intoDateEnd}::timestamp with time zone + interval '1 day'
|
|
AND tpid.into_date < #{intoDateEnd}::timestamp with time zone + interval '1 day'
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="skuName != null and skuName!='' ">
|
|
|
|
|
+ AND tmgs.sku_name LIKE concat('%',my_ex.likequery(#{skuName}),'%')
|
|
|
|
|
+ </if>
|
|
|
<if test="cpId != null">
|
|
<if test="cpId != null">
|
|
|
AND tpii.cp_id = #{cpId}
|
|
AND tpii.cp_id = #{cpId}
|
|
|
</if>
|
|
</if>
|