|
|
@@ -204,6 +204,14 @@
|
|
|
<result column="short_name" property="shortName"/>
|
|
|
<result column="price_purchase" property="pricePurchase"/>
|
|
|
<result column="price_standard" property="priceStandard"/>
|
|
|
+ <result column="order_qty" property="orderQty"/>
|
|
|
+ <result column="price_out" property="priceOut"/>
|
|
|
+ <result column="inv_id" property="invId"/>
|
|
|
+ <result column="wh_id" property="whId"/>
|
|
|
+ <result column="inv_qty" property="invQty"/>
|
|
|
+ <result column="usable_qty" property="usableQty"/>
|
|
|
+ <result column="wh_name" property="whName"/>
|
|
|
+
|
|
|
</resultMap>
|
|
|
<!--小程序用 总单-->
|
|
|
<sql id="Base_Column_List_Detail_Join">
|
|
|
@@ -243,9 +251,11 @@
|
|
|
toi.item_index AS list_item_index,
|
|
|
toi.sku_id AS list_sku_id,
|
|
|
toi.item_qty AS list_item_qty,
|
|
|
+ toi.item_qty AS list_order_qty,
|
|
|
toi.price_std AS list_price_std,
|
|
|
toi.amt_std AS list_amt_std,
|
|
|
toi.price_sale AS list_price_sale,
|
|
|
+ toi.price_sale AS list_price_out,
|
|
|
toi.item_amt AS list_item_amt,
|
|
|
toi.price_discount AS list_price_discount,
|
|
|
toi.non_std_code AS list_non_std_code,
|
|
|
@@ -265,7 +275,12 @@
|
|
|
tmgb.brand_name AS list_brand_name,
|
|
|
tmgb.short_name AS list_short_name,
|
|
|
tmgs.price_purchase AS list_price_purchase,
|
|
|
- tmgs.price_standard AS list_price_standard
|
|
|
+ tmgs.price_standard AS list_price_standard,
|
|
|
+ i.inv_id as list_inv_id,
|
|
|
+ i.wh_id as list_wh_id,
|
|
|
+ i.inv_qty as list_inv_qty,
|
|
|
+ i.usable_qty as list_usable_qty,
|
|
|
+ i.wh_name as list_wh_name
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
@@ -870,8 +885,23 @@
|
|
|
<include refid="Base_Column_List_Item_Response_Detail_Join"/>
|
|
|
FROM dkic_b.t_psi_order as t
|
|
|
left join dkic_b.t_psi_order_item toi on toi.order_id = t.order_id
|
|
|
- left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = toi.sku_id
|
|
|
+ inner join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = toi.sku_id
|
|
|
left join dkic_b.t_mst_goods_brand tmgb on tmgb.brand_id = tmgs.brand_id
|
|
|
+ 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 = toi.sku_id and i.non_std_code = toi.non_std_code and i.cp_id = toi.cp_id
|
|
|
<include refid="Condition"/>
|
|
|
order by t.op_create_time desc
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|