|
|
@@ -498,4 +498,55 @@
|
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
|
</select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 条件查询 (入库成本核对用) -->
|
|
|
+ <select id="selectCostCheck" resultMap="BaseResultMapResponse">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List_Response"/>
|
|
|
+ ,tpid.into_no as "intoNo"
|
|
|
+ ,tmgs.sku_code as "skuCode"
|
|
|
+ ,tmgs.sku_model as "skuModel"
|
|
|
+ ,tmgs.sku_name as "skuName"
|
|
|
+ ,tmgs.sku_spec as "skuSpec"
|
|
|
+ ,tmgb.brand_name as "brandName"
|
|
|
+ ,tmgb.short_name as "shortName"
|
|
|
+ ,tpp.pur_id as "purId"
|
|
|
+ ,tpp.pur_no as "purNo"
|
|
|
+ ,tppi.item_qty as "purItemQty"
|
|
|
+ ,tppi.intoing_qty as "purItemIntoingQty"
|
|
|
+ ,tppi.into_qty as "purItemIntoQty"
|
|
|
+ ,tpiv.inv_qty
|
|
|
+ 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_inventory tpiv on tpiv.inv_id = tpii.inv_id
|
|
|
+ left join dkic_b.t_psi_purchase_item tppi on tppi.item_id = tpii.from_item_id
|
|
|
+ left join dkic_b.t_psi_purchase tpp on tpp.pur_id = tpii.from_id
|
|
|
+ left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tpii.sku_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_mst_warehouse tmw on tmw.wh_id = tpii.wh_id
|
|
|
+ <where>
|
|
|
+ tpii.flg_valid
|
|
|
+ <if test="intoId != null and intoId != ''">
|
|
|
+ AND tpii.into_id = #{intoId}::uuid
|
|
|
+ </if>
|
|
|
+ <if test="intoNo != null and intoNo != ''">
|
|
|
+ AND tpid.into_no LIKE concat('%',my_ex.likequery(#{intoNo}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="intoDataStart != null">
|
|
|
+ AND tpid.into_date >= #{intoDataStart}::timestamp with time zone
|
|
|
+ </if>
|
|
|
+ <if test="intoDateEnd != null">
|
|
|
+ AND tpid.into_date < #{intoDateEnd}::timestamp with time zone + interval '1 day'
|
|
|
+ </if>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND tpii.cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|