|
|
@@ -830,42 +830,44 @@
|
|
|
|
|
|
<!-- 查询库存 -->
|
|
|
<select id="getInventory" resultType="java.util.Map">
|
|
|
- select tpi.sku_id as "skuId",
|
|
|
- tmgs.sku_code as "skuCode",
|
|
|
- tmgs.sku_name as "skuName",
|
|
|
- tmgs.sku_model as "skuModel",
|
|
|
- tmgs.brand_id as "brandId",
|
|
|
- tmgb.brand_name as "brandName",
|
|
|
- tmgs.category_id as "categoryId",
|
|
|
- tmgc.cat_name as "categoryName",
|
|
|
- tmgs.unit_id as "unitId",
|
|
|
- tmgu.unit_name as "unitName",
|
|
|
- tmgs.sub_unit_id as "subUnitId",
|
|
|
- tmgs.conversion_factor as "conversionFactor",
|
|
|
- tmgs.series_id as "seriesId",
|
|
|
- tmgseries.series_name as "seriesName",
|
|
|
- tmgs.sku_spec as "skuSpec",
|
|
|
- tmgs.price_purchase as "pricePurchase",
|
|
|
- tmgs.price_standard as "priceStandard",
|
|
|
- tmgs.price_wholesale as "priceWholesale",
|
|
|
- tmgs.price_limited as "priceLimited",
|
|
|
- tmgs.sku_images as "skuImages",
|
|
|
- tpi.non_std_code as "nonStdCode",
|
|
|
- tpi.inv_qty as "invQty",
|
|
|
- tpi.outing_qty as "outingQty",
|
|
|
- tpi.usable_qty as "usableQty",
|
|
|
- tmw.wh_code as "whCode",
|
|
|
- tmw.wh_name as "whName",
|
|
|
- tpi.remarks
|
|
|
+ select tpi.inv_id as "invId",
|
|
|
+ tpi.sku_id as "skuId",
|
|
|
+ tmgs.sku_code as "skuCode",
|
|
|
+ tmgs.sku_name as "skuName",
|
|
|
+ tmgs.sku_model as "skuModel",
|
|
|
+ tmgs.brand_id as "brandId",
|
|
|
+ tmgb.brand_name as "brandName",
|
|
|
+ tmgs.category_id as "categoryId",
|
|
|
+ tmgc.cat_name as "categoryName",
|
|
|
+ tmgs.unit_id as "unitId",
|
|
|
+ tmgu.unit_name as "unitName",
|
|
|
+ tmgs.sub_unit_id as "subUnitId",
|
|
|
+ tmgs.conversion_factor as "conversionFactor",
|
|
|
+ tmgs.series_id as "seriesId",
|
|
|
+ tmgseries.series_name as "seriesName",
|
|
|
+ tmgs.sku_spec as "skuSpec",
|
|
|
+ tmgs.price_purchase as "pricePurchase",
|
|
|
+ tmgs.price_standard as "priceStandard",
|
|
|
+ tmgs.price_wholesale as "priceWholesale",
|
|
|
+ tmgs.price_limited as "priceLimited",
|
|
|
+ tmgs.sku_images as "skuImages",
|
|
|
+ tpi.non_std_code as "nonStdCode",
|
|
|
+ tpi.inv_qty as "invQty",
|
|
|
+ tpi.outing_qty as "outingQty",
|
|
|
+ tpi.usable_qty as "usableQty",
|
|
|
+ tpi.wh_id as "whId",
|
|
|
+ tmw.wh_code as "whCode",
|
|
|
+ tmw.wh_name as "whName",
|
|
|
+ tpi.remarks
|
|
|
from dkic_b.t_psi_inventory as tpi
|
|
|
- inner join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
|
|
|
- inner join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = tpi.sku_id
|
|
|
- left join dkic_b.t_mst_goods_brand as tmgb on tmgs.brand_id = tmgb.brand_id
|
|
|
- left join dkic_b.t_mst_goods_category as tmgc on tmgs.category_id = tmgc.cat_id
|
|
|
- left join dkic_b.t_mst_goods_series as tmgseries on tmgs.series_id = tmgseries.series_id
|
|
|
- left join dkic_b.t_mst_unit as tmgu on tmgs.unit_id = tmgu.unit_id
|
|
|
+ inner join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
|
|
|
+ inner join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = tpi.sku_id
|
|
|
+ left join dkic_b.t_mst_goods_brand as tmgb on tmgs.brand_id = tmgb.brand_id
|
|
|
+ left join dkic_b.t_mst_goods_category as tmgc on tmgs.category_id = tmgc.cat_id
|
|
|
+ left join dkic_b.t_mst_goods_series as tmgseries on tmgs.series_id = tmgseries.series_id
|
|
|
+ left join dkic_b.t_mst_unit as tmgu on tmgs.unit_id = tmgu.unit_id
|
|
|
where tpi.flg_valid
|
|
|
- AND tpi.cp_id = #{cpId}
|
|
|
+ AND tpi.cp_id = #{cpId}
|
|
|
<if test="skuId != null">
|
|
|
AND tpi.sku_id = #{skuId} ::uuid
|
|
|
</if>
|
|
|
@@ -873,13 +875,13 @@
|
|
|
AND tpi.non_std_code = #{nonStdCode}
|
|
|
</if>
|
|
|
<if test="skuCode != null">
|
|
|
- AND tmgs.sku_code = #{skuCode}
|
|
|
+ AND tmgs.sku_code LIKE concat('%',my_ex.likequery(#{skuCode}),'%')
|
|
|
</if>
|
|
|
<if test="skuName != null">
|
|
|
- AND tmgs.sku_name = #{skuName}
|
|
|
+ AND tmgs.sku_name LIKE concat('%',my_ex.likequery(#{skuName}),'%')
|
|
|
</if>
|
|
|
<if test="whName != null">
|
|
|
- AND tmgs.wh_name = #{whName}
|
|
|
+ AND tmgs.wh_name LIKE concat('%',my_ex.likequery(#{whName}),'%')
|
|
|
</if>
|
|
|
</select>
|
|
|
|