|
|
@@ -108,7 +108,7 @@
|
|
|
<result column="inv_id" property="invId"/>
|
|
|
<result column="inv_qty" property="invQty"/>
|
|
|
<result column="usable_qty" property="usableQty"/>
|
|
|
-
|
|
|
+ <result column="skuImages" property="skuImages" typeHandler="JsonTypeHandler"/>
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
@@ -304,6 +304,7 @@
|
|
|
,tmgs.sku_code as "skuCode"
|
|
|
,tmgs.sku_model as "skuModel"
|
|
|
,tmgs.sku_name as "skuName"
|
|
|
+ ,tmgs.sku_images as "skuImages"
|
|
|
,tmgb.brand_name as "brandName"
|
|
|
,tmgb.short_name as "shortName"
|
|
|
,tmgs.sku_spec as "skuSpec"
|
|
|
@@ -343,6 +344,63 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <!-- 查询表dkic_b.t_psi_purchase_item,(条件查询+分页)列表 -->
|
|
|
+ <select id="purSelectByCond" resultMap="BaseResultMapResponse">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List_Response"/>
|
|
|
+ ,tppi.from_id as "fromId"
|
|
|
+ ,tppi.from_item_id as "fromItemId"
|
|
|
+ ,tpo.order_no as "orderNo"
|
|
|
+ ,tmgs.sku_code as "skuCode"
|
|
|
+ ,tmgs.sku_model as "skuModel"
|
|
|
+ ,tmgs.sku_name as "skuName"
|
|
|
+ ,tmgs.sku_images as "skuImages"
|
|
|
+ ,tmgb.brand_name as "brandName"
|
|
|
+ ,tmgb.short_name as "shortName"
|
|
|
+ ,tmgs.sku_spec as "skuSpec"
|
|
|
+ ,tmgs.price_purchase as "pricePurchase"
|
|
|
+ ,tmgs.price_standard as "priceStandard"
|
|
|
+ ,sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "intoStatusName"
|
|
|
+ ,
|
|
|
+ i.inv_id,
|
|
|
+ i.inv_qty,
|
|
|
+ i.usable_qty
|
|
|
+ ,tpp.pur_no as "purNo"
|
|
|
+ FROM dkic_b.t_psi_purchase_item tppi
|
|
|
+ left join(SELECT T.*
|
|
|
+ FROM (select tpi.inv_id,
|
|
|
+ tpi.wh_id,
|
|
|
+ tpi.inv_qty,
|
|
|
+ tpi.usable_qty,
|
|
|
+ tpi.sku_id,
|
|
|
+ tpi.non_std_code,
|
|
|
+ tpi.cp_id,
|
|
|
+ tmw.wh_name,
|
|
|
+ rank()
|
|
|
+ over (partition by tpi.cp_id,tpi.sku_id,tpi.non_std_code order by tpi.inv_id) as RK
|
|
|
+ from dkic_b.t_psi_inventory as tpi
|
|
|
+ left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id) T
|
|
|
+ WHERE T.RK = 1) as i on i.sku_id = tppi.sku_id and i.non_std_code = tppi.non_std_code and i.cp_id = tppi.cp_id
|
|
|
+ left join dkic_b.t_psi_order tpo on tpo.order_id = tppi.from_id
|
|
|
+ left join dkic_b.t_mst_goods_sku tmgs on tppi.sku_id = tmgs.sku_id
|
|
|
+ left join dkic_b.t_mst_goods_brand tmgb on tmgb.brand_id = tmgs.brand_id
|
|
|
+ left join sys.t_data_kind tdk1 on tdk1.kind_code = tppi.into_status
|
|
|
+ left join dkic_b.t_psi_purchase tpp on tpp.pur_id = tppi.pur_id
|
|
|
+ where
|
|
|
+ tppi.into_status != '入库状态-已入库'
|
|
|
+ AND tppi.flg_valid = true
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND tppi.cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ <if test="purId != null and purId != ''">
|
|
|
+ AND tppi.pur_id = #{purId}::uuid
|
|
|
+ </if>
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
<!-- 查询表dkic_b.t_psi_purchase_item,(条件查询)个数 -->
|
|
|
<select id="countByCond" resultType="Long">
|
|
|
SELECT
|