|
|
@@ -5,7 +5,8 @@
|
|
|
<!-- 通用设置 -->
|
|
|
<!-- 通用查询列 -->
|
|
|
<sql id="Base_Column_List">
|
|
|
- item_id , order_id, item_index, sku_id, item_qty, price_std, amt_std, price_sale, item_amt, price_discount, non_std_code, out_status, outing_qty, outing_amt, out_qty, out_amt, return_qty, return_amt, remarks, flg_valid, cp_id, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
|
|
|
+ item_id
|
|
|
+ , order_id, item_index, sku_id, item_qty, price_std, amt_std, price_sale, item_amt, price_discount, non_std_code, out_status, outing_qty, outing_amt, out_qty, out_amt, return_qty, return_amt, remarks, flg_valid, cp_id, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
|
|
|
</sql>
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
@@ -237,7 +238,39 @@
|
|
|
</insert>
|
|
|
|
|
|
<delete id="deleteById">
|
|
|
- DELETE FROM dkic_b.t_psi_order_item
|
|
|
+ DELETE
|
|
|
+ FROM dkic_b.t_psi_order_item
|
|
|
WHERE item_id = #{id}::UUID;
|
|
|
</delete>
|
|
|
+
|
|
|
+ <!-- 根据条件进行查询(出库用) -->
|
|
|
+ <select id="selectByCondForOut" resultMap="BaseResultMap">
|
|
|
+ SELECT tpoi.item_id,
|
|
|
+ tpoi.order_id,
|
|
|
+ tpoi.item_index,
|
|
|
+ tpoi.sku_id,
|
|
|
+ tmgs.sku_code as "skuCode",
|
|
|
+ tmgs.sku_model as "skuModel",
|
|
|
+ tmgs.sku_name as "skuName",
|
|
|
+ tpoi.item_qty as "orderQty",
|
|
|
+ tpoi.item_qty - tpoi.outing_qty as "canOutingQty",
|
|
|
+ tpoi.item_qty - tpoi.outing_qty as outing_qty,
|
|
|
+ tpoi.price_std * (tpoi.item_qty - tpoi.outing_qty) as item_amt,
|
|
|
+ tpoi.price_sale as "price_out",
|
|
|
+ tpoi.non_std_code,
|
|
|
+ tpoi.remarks,
|
|
|
+ tpi.inv_id as "invId",
|
|
|
+ tpi.wh_id as "whId",
|
|
|
+ tpi.inv_qty as "invQty",
|
|
|
+ tpi.usable_qty as "usableQty",
|
|
|
+ tmw.wh_name as "whName"
|
|
|
+ FROM dkic_b.t_psi_order_item as tpoi
|
|
|
+ inner join dkic_b.t_mst_goods_sku tmgs on tpoi.sku_id = tmgs.sku_id
|
|
|
+ left join dkic_b.t_psi_inventory as tpi
|
|
|
+ on tpi.sku_id = tpoi.sku_id and tpi.non_std_code = tpoi.non_std_code and
|
|
|
+ tpi.cp_id = tpoi.cp_id
|
|
|
+ left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
|
|
|
+ where tpoi.order_id = #{orderId}::uuid
|
|
|
+ order by tpoi.item_index
|
|
|
+ </select>
|
|
|
</mapper>
|