|
|
@@ -5,7 +5,8 @@
|
|
|
<!-- 通用设置 -->
|
|
|
<!-- 通用查询列 -->
|
|
|
<sql id="Base_Column_List">
|
|
|
- item_id, out_id, out_type, from_id, from_item_id, item_index, sku_id, price_out, non_std_code,
|
|
|
+ item_id
|
|
|
+ , out_id, out_type, from_id, from_item_id, item_index, sku_id, price_out, non_std_code,
|
|
|
out_status, outing_qty, outing_amt, out_qty, out_amt, return_qty, return_amt, remarks,
|
|
|
inv_id, cost_price, cost_amt, 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,
|
|
|
@@ -13,7 +14,10 @@
|
|
|
</sql>
|
|
|
|
|
|
<sql id="Base_Column_List_Response">
|
|
|
- tpoi.item_id, tpoi.out_id, tpoi.out_type, tpoi.from_id, tpoi.from_item_id, tpoi.item_index,
|
|
|
+ tpoi
|
|
|
+ .
|
|
|
+ item_id
|
|
|
+ , tpoi.out_id, tpoi.out_type, tpoi.from_id, tpoi.from_item_id, tpoi.item_index,
|
|
|
tpoi.sku_id, tpoi.price_out, tpoi.non_std_code, tpoi.out_status, tpoi.outing_qty, tpoi.outing_amt,
|
|
|
tpoi.out_qty, tpoi.out_amt, tpoi.return_qty, tpoi.return_amt, tpoi.remarks, tpoi.inv_id,
|
|
|
tpoi.cost_price, tpoi.cost_amt, tpoi.flg_valid, tpoi.cp_id,
|
|
|
@@ -24,64 +28,64 @@
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
<resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.ivt.OutboundItem">
|
|
|
<id column="item_id" property="itemId"/>
|
|
|
- <result column="out_id" property="outId" typeHandler="UuidTypeHandler"/>
|
|
|
- <result column="out_type" property="outType"/>
|
|
|
- <result column="from_id" property="fromId" typeHandler="UuidTypeHandler"/>
|
|
|
- <result column="from_item_id" property="fromItemId" typeHandler="UuidTypeHandler"/>
|
|
|
- <result column="item_index" property="itemIndex"/>
|
|
|
- <result column="sku_id" property="skuId" typeHandler="UuidTypeHandler"/>
|
|
|
- <result column="price_out" property="priceOut"/>
|
|
|
- <result column="non_std_code" property="nonStdCode"/>
|
|
|
- <result column="out_status" property="outStatus"/>
|
|
|
- <result column="outing_qty" property="outingQty"/>
|
|
|
- <result column="outing_amt" property="outingAmt"/>
|
|
|
- <result column="out_qty" property="outQty"/>
|
|
|
- <result column="out_amt" property="outAmt"/>
|
|
|
- <result column="return_qty" property="returnQty"/>
|
|
|
- <result column="return_amt" property="returnAmt"/>
|
|
|
- <result column="remarks" property="remarks"/>
|
|
|
- <result column="inv_id" property="invId" typeHandler="UuidTypeHandler"/>
|
|
|
- <result column="cost_price" property="costPrice"/>
|
|
|
- <result column="cost_amt" property="costAmt"/>
|
|
|
- <result column="flg_valid" property="flgValid"/>
|
|
|
- <result column="cp_id" property="cpId"/>
|
|
|
- <result column="op_create_time" property="opCreateTime" typeHandler="TimestampTypeHandler"/>
|
|
|
- <result column="op_create_user_id" property="opCreateUserId" typeHandler="UuidTypeHandler"/>
|
|
|
- <result column="op_update_time" property="opUpdateTime" typeHandler="TimestampTypeHandler"/>
|
|
|
- <result column="op_update_user_id" property="opUpdateUserId" typeHandler="UuidTypeHandler"/>
|
|
|
- <result column="op_app_code" property="opAppCode"/>
|
|
|
- <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
|
|
|
- <result column="op_db_user" property="opDbUser"/>
|
|
|
- <result column="s_out_id" property="sOutId" typeHandler="UuidTypeHandler"/>
|
|
|
- <result column="s_out_item_id" property="sOutItemId" typeHandler="UuidTypeHandler"/>
|
|
|
- <result column="s_order_id" property="sOrderId" typeHandler="UuidTypeHandler"/>
|
|
|
- <result column="s_order_item_id" property="sOrderItemId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="out_id" property="outId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="out_type" property="outType"/>
|
|
|
+ <result column="from_id" property="fromId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="from_item_id" property="fromItemId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="item_index" property="itemIndex"/>
|
|
|
+ <result column="sku_id" property="skuId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="price_out" property="priceOut"/>
|
|
|
+ <result column="non_std_code" property="nonStdCode"/>
|
|
|
+ <result column="out_status" property="outStatus"/>
|
|
|
+ <result column="outing_qty" property="outingQty"/>
|
|
|
+ <result column="outing_amt" property="outingAmt"/>
|
|
|
+ <result column="out_qty" property="outQty"/>
|
|
|
+ <result column="out_amt" property="outAmt"/>
|
|
|
+ <result column="return_qty" property="returnQty"/>
|
|
|
+ <result column="return_amt" property="returnAmt"/>
|
|
|
+ <result column="remarks" property="remarks"/>
|
|
|
+ <result column="inv_id" property="invId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="cost_price" property="costPrice"/>
|
|
|
+ <result column="cost_amt" property="costAmt"/>
|
|
|
+ <result column="flg_valid" property="flgValid"/>
|
|
|
+ <result column="cp_id" property="cpId"/>
|
|
|
+ <result column="op_create_time" property="opCreateTime" typeHandler="TimestampTypeHandler"/>
|
|
|
+ <result column="op_create_user_id" property="opCreateUserId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="op_update_time" property="opUpdateTime" typeHandler="TimestampTypeHandler"/>
|
|
|
+ <result column="op_update_user_id" property="opUpdateUserId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="op_app_code" property="opAppCode"/>
|
|
|
+ <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
|
|
|
+ <result column="op_db_user" property="opDbUser"/>
|
|
|
+ <result column="s_out_id" property="sOutId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="s_out_item_id" property="sOutItemId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="s_order_id" property="sOrderId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="s_order_item_id" property="sOrderItemId" typeHandler="UuidTypeHandler"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
<resultMap id="BaseResultMapResponse" type="com.dk.mdm.model.response.ivt.OutboundItemResponse">
|
|
|
<id column="item_id" property="itemId"/>
|
|
|
- <result column="out_id" property="outId" typeHandler="UuidTypeHandler"/>
|
|
|
- <result column="out_type" property="outType"/>
|
|
|
- <result column="from_id" property="fromId" typeHandler="UuidTypeHandler"/>
|
|
|
- <result column="from_item_id" property="fromItemId" typeHandler="UuidTypeHandler"/>
|
|
|
- <result column="item_index" property="itemIndex"/>
|
|
|
- <result column="sku_id" property="skuId" typeHandler="UuidTypeHandler"/>
|
|
|
- <result column="price_out" property="priceOut"/>
|
|
|
- <result column="non_std_code" property="nonStdCode"/>
|
|
|
- <result column="out_status" property="outStatus"/>
|
|
|
- <result column="outing_qty" property="outingQty"/>
|
|
|
- <result column="outing_amt" property="outingAmt"/>
|
|
|
- <result column="out_qty" property="outQty"/>
|
|
|
- <result column="out_amt" property="outAmt"/>
|
|
|
- <result column="return_qty" property="returnQty"/>
|
|
|
- <result column="return_amt" property="returnAmt"/>
|
|
|
- <result column="remarks" property="remarks"/>
|
|
|
- <result column="inv_id" property="invId" typeHandler="UuidTypeHandler"/>
|
|
|
- <result column="cost_price" property="costPrice"/>
|
|
|
- <result column="cost_amt" property="costAmt"/>
|
|
|
- <result column="flg_valid" property="flgValid"/>
|
|
|
- <result column="cp_id" property="cpId"/>
|
|
|
+ <result column="out_id" property="outId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="out_type" property="outType"/>
|
|
|
+ <result column="from_id" property="fromId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="from_item_id" property="fromItemId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="item_index" property="itemIndex"/>
|
|
|
+ <result column="sku_id" property="skuId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="price_out" property="priceOut"/>
|
|
|
+ <result column="non_std_code" property="nonStdCode"/>
|
|
|
+ <result column="out_status" property="outStatus"/>
|
|
|
+ <result column="outing_qty" property="outingQty"/>
|
|
|
+ <result column="outing_amt" property="outingAmt"/>
|
|
|
+ <result column="out_qty" property="outQty"/>
|
|
|
+ <result column="out_amt" property="outAmt"/>
|
|
|
+ <result column="return_qty" property="returnQty"/>
|
|
|
+ <result column="return_amt" property="returnAmt"/>
|
|
|
+ <result column="remarks" property="remarks"/>
|
|
|
+ <result column="inv_id" property="invId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="cost_price" property="costPrice"/>
|
|
|
+ <result column="cost_amt" property="costAmt"/>
|
|
|
+ <result column="flg_valid" property="flgValid"/>
|
|
|
+ <result column="cp_id" property="cpId"/>
|
|
|
<result column="s_out_id" property="sOutId" typeHandler="UuidTypeHandler"/>
|
|
|
<result column="s_out_item_id" property="sOutItemId" typeHandler="UuidTypeHandler"/>
|
|
|
<result column="s_order_id" property="sOrderId" typeHandler="UuidTypeHandler"/>
|
|
|
@@ -168,40 +172,40 @@
|
|
|
<!-- 查询表t_psi_outbound_item,(条件查询+分页)列表 -->
|
|
|
<select id="selectByCond" resultMap="BaseResultMapResponse">
|
|
|
SELECT tpoi.item_id,
|
|
|
- tpoi.out_id,
|
|
|
- tpoi.out_type,
|
|
|
- tpoi.from_id,
|
|
|
- tpoi.from_item_id,
|
|
|
- tpoi.item_index,
|
|
|
- tpoi.sku_id,
|
|
|
- tmgs.sku_code as "skuCode",
|
|
|
- tmgs.sku_model as "skuModel",
|
|
|
- tmgs.sku_name as "skuName",
|
|
|
- tpoi.price_out,
|
|
|
- tpoi.non_std_code,
|
|
|
- tpoi.out_status,
|
|
|
- tpoi.outing_qty,
|
|
|
- tpoi.outing_amt,
|
|
|
- tpoi.out_qty,
|
|
|
- tpoi.out_amt,
|
|
|
- tpoi.return_qty,
|
|
|
- tpoi.return_amt,
|
|
|
- tpoi.remarks,
|
|
|
- tpoi.inv_id,
|
|
|
- tpoi.cost_price,
|
|
|
- tpoi.cost_amt,
|
|
|
- tpoi.flg_valid,
|
|
|
- tpoi.cp_id,
|
|
|
- tpi.wh_id as "whId",
|
|
|
- tpi.inv_qty as "invQty",
|
|
|
- tpi.usable_qty as "usableQty",
|
|
|
- tmw.wh_name as "whName",
|
|
|
- sys.f_get_name_i18n(tdk.kind_name_i18n, #{i18n}) as "outStatusName"
|
|
|
+ tpoi.out_id,
|
|
|
+ tpoi.out_type,
|
|
|
+ tpoi.from_id,
|
|
|
+ tpoi.from_item_id,
|
|
|
+ tpoi.item_index,
|
|
|
+ tpoi.sku_id,
|
|
|
+ tmgs.sku_code as "skuCode",
|
|
|
+ tmgs.sku_model as "skuModel",
|
|
|
+ tmgs.sku_name as "skuName",
|
|
|
+ tpoi.price_out,
|
|
|
+ tpoi.non_std_code,
|
|
|
+ tpoi.out_status,
|
|
|
+ tpoi.outing_qty,
|
|
|
+ tpoi.outing_amt,
|
|
|
+ tpoi.out_qty,
|
|
|
+ tpoi.out_amt,
|
|
|
+ tpoi.return_qty,
|
|
|
+ tpoi.return_amt,
|
|
|
+ tpoi.remarks,
|
|
|
+ tpoi.inv_id,
|
|
|
+ tpoi.cost_price,
|
|
|
+ tpoi.cost_amt,
|
|
|
+ tpoi.flg_valid,
|
|
|
+ tpoi.cp_id,
|
|
|
+ tpi.wh_id as "whId",
|
|
|
+ tpi.inv_qty as "invQty",
|
|
|
+ tpi.usable_qty as "usableQty",
|
|
|
+ tmw.wh_name as "whName",
|
|
|
+ sys.f_get_name_i18n(tdk.kind_name_i18n, #{i18n}) as "outStatusName"
|
|
|
FROM dkic_b.t_psi_outbound_item as tpoi
|
|
|
- left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tpoi.sku_id
|
|
|
- left join dkic_b.t_psi_inventory as tpi on tpi.inv_id = tpoi.inv_id
|
|
|
- left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
|
|
|
- left join sys.t_data_kind as tdk on tdk.kind_code = tpoi.out_status
|
|
|
+ left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tpoi.sku_id
|
|
|
+ left join dkic_b.t_psi_inventory as tpi on tpi.inv_id = tpoi.inv_id
|
|
|
+ left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
|
|
|
+ left join sys.t_data_kind as tdk on tdk.kind_code = tpoi.out_status
|
|
|
<include refid="Condition"/>
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
|
@@ -316,23 +320,23 @@
|
|
|
t.from_id,
|
|
|
t.item_index,
|
|
|
t.sku_id,
|
|
|
- tmgs.sku_code as "skuCode",
|
|
|
- tmgs.sku_model as "skuModel",
|
|
|
- tmgs.sku_name as "skuName",
|
|
|
- tpoi.item_qty as "orderQty",
|
|
|
+ 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 - tpoi.out_qty + t.outing_qty + t.out_qty as "canOutingQty",
|
|
|
t.price_out,
|
|
|
- t.outing_qty + t.out_qty as outing_qty,
|
|
|
- t.outing_amt + t.out_amt as outing_amt,
|
|
|
+ t.outing_qty + t.out_qty as outing_qty,
|
|
|
+ t.outing_amt + t.out_amt as outing_amt,
|
|
|
t.out_qty,
|
|
|
t.out_amt,
|
|
|
t.non_std_code,
|
|
|
t.remarks,
|
|
|
t.inv_id,
|
|
|
- tpi.wh_id as "whId",
|
|
|
- tpi.inv_qty as "invQty",
|
|
|
- tpi.usable_qty as "usableQty",
|
|
|
- tmw.wh_name as "whName"
|
|
|
+ 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_outbound_item as t
|
|
|
left join dkic_b.t_psi_order_item as tpoi on tpoi.item_id = t.from_item_id
|
|
|
left join dkic_b.t_mst_goods_sku tmgs on tpoi.sku_id = tmgs.sku_id
|
|
|
@@ -345,17 +349,17 @@
|
|
|
|
|
|
<!-- 获取出库信息(新建退货用) -->
|
|
|
<select id="selectByCondForReturn" resultMap="BaseResultMapResponse">
|
|
|
- SELECT t.out_id as "sOutId",
|
|
|
- t.item_id as "sOutItemId",
|
|
|
+ SELECT t.out_id as "sOutId",
|
|
|
+ t.item_id as "sOutItemId",
|
|
|
t.sku_id,
|
|
|
- tmgs.sku_code as "skuCode",
|
|
|
- tmgs.sku_model as "skuModel",
|
|
|
- tmgs.sku_name as "skuName",
|
|
|
- t.out_qty as "outboundOutQty",
|
|
|
- t.out_qty - t.return_qty as "canReturnQty",
|
|
|
- - (t.out_qty - t.return_qty) as outing_qty,
|
|
|
+ tmgs.sku_code as "skuCode",
|
|
|
+ tmgs.sku_model as "skuModel",
|
|
|
+ tmgs.sku_name as "skuName",
|
|
|
+ t.out_qty as "outboundOutQty",
|
|
|
+ t.out_qty - t.return_qty as "canReturnQty",
|
|
|
+ - (t.out_qty - t.return_qty) as outing_qty,
|
|
|
t.price_out,
|
|
|
- - t.price_out * (t.out_qty - t.return_qty) as outing_amt,
|
|
|
+ - t.price_out * (t.out_qty - t.return_qty) as outing_amt,
|
|
|
t.inv_id,
|
|
|
t.non_std_code,
|
|
|
t.remarks
|
|
|
@@ -378,19 +382,19 @@
|
|
|
t.s_order_item_id,
|
|
|
t.item_index,
|
|
|
t.sku_id,
|
|
|
- tmgs.sku_code as "skuCode",
|
|
|
- tmgs.sku_model as "skuModel",
|
|
|
- tmgs.sku_name as "skuName",
|
|
|
- COALESCE(tpobi.out_qty, 0) as "outboundOutQty",
|
|
|
+ tmgs.sku_code as "skuCode",
|
|
|
+ tmgs.sku_model as "skuModel",
|
|
|
+ tmgs.sku_name as "skuName",
|
|
|
+ COALESCE(tpobi.out_qty, 0) as "outboundOutQty",
|
|
|
COALESCE(tpobi.out_qty, 0) - COALESCE(tpobi.return_qty, 0) + t.outing_qty + t.out_qty as "canReturnQty",
|
|
|
t.inv_id,
|
|
|
tpi.wh_id,
|
|
|
- tpi.inv_qty as "invQty",
|
|
|
- tpi.usable_qty as "usableQty",
|
|
|
- tmw.wh_name as "whName",
|
|
|
+ tpi.inv_qty as "invQty",
|
|
|
+ tpi.usable_qty as "usableQty",
|
|
|
+ tmw.wh_name as "whName",
|
|
|
t.price_out,
|
|
|
- t.outing_qty + t.out_qty as outing_qty,
|
|
|
- t.outing_amt + t.out_amt as outing_amt,
|
|
|
+ t.outing_qty + t.out_qty as outing_qty,
|
|
|
+ t.outing_amt + t.out_amt as outing_amt,
|
|
|
t.non_std_code,
|
|
|
t.remarks
|
|
|
FROM dkic_b.t_psi_outbound_item as t
|
|
|
@@ -416,7 +420,101 @@
|
|
|
</if>
|
|
|
</set>
|
|
|
where item_id = #{itemId,typeHandler=UuidTypeHandler}
|
|
|
- and out_qty >= return_qty
|
|
|
+ and out_qty >= return_qty
|
|
|
</update>
|
|
|
|
|
|
+
|
|
|
+ <!-- 出库办理显示字段 -->
|
|
|
+ <sql id="Base_Column_List_Response_Out">
|
|
|
+ tpoi.item_id ,
|
|
|
+ tpoi.out_id ,
|
|
|
+ tpoi.out_type ,
|
|
|
+ tpoi.from_id,
|
|
|
+ tpoi.from_item_id,
|
|
|
+ tpoi.item_index,
|
|
|
+ tpoi.sku_id,
|
|
|
+ tpoi.price_out,
|
|
|
+ tpoi.non_std_code,
|
|
|
+ tpoi.out_status ,
|
|
|
+ tpoi.outing_qty ,
|
|
|
+ tpoi.outing_amt ,
|
|
|
+ tpoi.out_qty ,
|
|
|
+ tpoi.out_amt ,
|
|
|
+ tpoi.return_qty,
|
|
|
+ tpoi.return_amt,
|
|
|
+ tpoi.remarks,
|
|
|
+ tpoi.inv_id,
|
|
|
+ tpoi.cost_price,
|
|
|
+ tpoi.cost_amt
|
|
|
+ </sql>
|
|
|
+ <sql id="Base_Column_List_Response_Into">
|
|
|
+ tpii.item_id ,
|
|
|
+ tpii.into_id as out_id,
|
|
|
+ tpii.into_type as out_type,
|
|
|
+ tpii.from_id,
|
|
|
+ tpii.from_item_id,
|
|
|
+ tpii.item_index,
|
|
|
+ tpii.sku_id,
|
|
|
+ tpii.price_into as price_out,
|
|
|
+ tpii.non_std_code,
|
|
|
+ tpii.into_status,
|
|
|
+ tpii.intoing_qty as outing_qty ,
|
|
|
+ tpii.intoing_amt as outing_amt ,
|
|
|
+ tpii.into_qty as out_qty ,
|
|
|
+ tpii.into_amt as out_amt ,
|
|
|
+ tpii.return_qty,
|
|
|
+ tpii.return_amt,
|
|
|
+ tpii.remarks,
|
|
|
+ tpii.inv_id,
|
|
|
+ tpii.cost_price,
|
|
|
+ tpii.cost_amt
|
|
|
+ </sql>
|
|
|
+ <!--条件查询 web端出库办理用-->
|
|
|
+ <select id="selectOutboundItem" resultMap="BaseResultMapResponse">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List_Response_Out"/>
|
|
|
+ ,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"
|
|
|
+ from dkic_b.t_psi_outbound_item tpoi
|
|
|
+ <include refid="Select_Inbound_Join_Table_Out"/>
|
|
|
+ <where>
|
|
|
+ tpoi.flg_valid
|
|
|
+ <if test="outId != null and outId != ''">
|
|
|
+ AND tpoi.out_id = #{outId}::uuid
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ union all
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List_Response_Into"/>
|
|
|
+ ,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"
|
|
|
+ FROM dkic_b.t_psi_inbound_item tpii
|
|
|
+ <include refid="Select_Inbound_Join_Table_Into"/>
|
|
|
+ <where>
|
|
|
+ tpii.flg_valid
|
|
|
+ <if test="outId != null and outId != ''">
|
|
|
+ AND tpii.into_id = #{outId}::uuid
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <!--出库办理显示出库关联表-->
|
|
|
+ <sql id="Select_Inbound_Join_Table_Out">
|
|
|
+ left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tpoi.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 = tpoi.inv_id
|
|
|
+ </sql>
|
|
|
+ <sql id="Select_Inbound_Join_Table_Into">
|
|
|
+ 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
|
|
|
+ </sql>
|
|
|
+
|
|
|
</mapper>
|