|
@@ -8,6 +8,14 @@
|
|
|
item_id, transfer_id, transfer_date, item_index, sku_id, o_inv_id, inv_id, o_wh_id, transfer_qty, wh_id, o_non_std_code, non_std_code, price_into, intoing_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
|
|
item_id, transfer_id, transfer_date, item_index, sku_id, o_inv_id, inv_id, o_wh_id, transfer_qty, wh_id, o_non_std_code, non_std_code, price_into, intoing_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
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
+ <!-- 一览查询列 -->
|
|
|
|
|
+ <sql id="Base_Column_List_Response">
|
|
|
|
|
+ item.item_id, item.transfer_id, item.transfer_date, item.item_index, item.sku_id, item.o_inv_id, item.inv_id
|
|
|
|
|
+ , item.o_wh_id, item.transfer_qty, item.wh_id, item.o_non_std_code, item.non_std_code, item.price_into, item.intoing_amt
|
|
|
|
|
+ ,inv.non_std_code,oinv.non_std_code AS "oNonStdCode",wh.wh_Name AS "whName",owh.wh_Name AS "oWhName",item.flg_valid
|
|
|
|
|
+ ,sku.sku_code,sku.sku_name,sku.sku_model,brand.short_name
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
<!-- 通用查询映射结果 -->
|
|
<!-- 通用查询映射结果 -->
|
|
|
<resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.ivt.TransferItem">
|
|
<resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.ivt.TransferItem">
|
|
|
<id column="item_id" property="itemId"/>
|
|
<id column="item_id" property="itemId"/>
|
|
@@ -35,11 +43,37 @@
|
|
|
<result column="op_db_user" property="opDbUser"/>
|
|
<result column="op_db_user" property="opDbUser"/>
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
+ <!-- 一览查询映射结果 -->
|
|
|
|
|
+ <resultMap id="BaseResultMap_Response" type="com.dk.mdm.model.response.ivt.TransferItemResponse">
|
|
|
|
|
+ <id column="item_id" property="itemId"/>
|
|
|
|
|
+ <result column="transfer_id" property="transferId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
+ <result column="transfer_date" property="transferDate" typeHandler="TimestampTypeHandler"/>
|
|
|
|
|
+ <result column="item_index" property="itemIndex"/>
|
|
|
|
|
+ <result column="sku_id" property="skuId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
+ <result column="o_inv_id" property="oInvId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
+ <result column="inv_id" property="invId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
+ <result column="o_wh_id" property="oWhId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
+ <result column="wh_id" property="whId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
+ <result column="o_non_std_code" property="oNonStdCode"/>
|
|
|
|
|
+ <result column="non_std_code" property="nonStdCode"/>
|
|
|
|
|
+ <result column="price_into" property="priceInto"/>
|
|
|
|
|
+ <result column="intoing_amt" property="intoingAmt"/>
|
|
|
|
|
+ <result column="transfer_qty" property="transferQty"/>
|
|
|
|
|
+ <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"/>
|
|
|
|
|
+ </resultMap>
|
|
|
<!-- 通用条件列 -->
|
|
<!-- 通用条件列 -->
|
|
|
<sql id="Condition">
|
|
<sql id="Condition">
|
|
|
<where>
|
|
<where>
|
|
|
<if test="transferId != null and transferId != ''">
|
|
<if test="transferId != null and transferId != ''">
|
|
|
- AND transfer_id = #{transferId}
|
|
|
|
|
|
|
+ AND transfer_id = #{transferId}::uuid
|
|
|
</if>
|
|
</if>
|
|
|
<if test="transferDate != null">
|
|
<if test="transferDate != null">
|
|
|
AND transfer_date = #{transferDate}
|
|
AND transfer_date = #{transferDate}
|
|
@@ -104,20 +138,27 @@
|
|
|
</where>
|
|
</where>
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
- <sql id="idsForeach">
|
|
|
|
|
- <!-- 根据主键itemId批量操作 -->
|
|
|
|
|
- WHERE item_id in
|
|
|
|
|
- <foreach collection="ids" index="index" item="item" separator="," open="(" close=")">
|
|
|
|
|
- #{item}
|
|
|
|
|
- </foreach>
|
|
|
|
|
|
|
+ <!-- 一览条件列 -->
|
|
|
|
|
+ <sql id="Condition_Response">
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="transferId != null and transferId != ''">
|
|
|
|
|
+ AND item.transfer_id = #{transferId}::uuid
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
<!-- 查询表t_psi_transfer_item,(条件查询+分页)列表 -->
|
|
<!-- 查询表t_psi_transfer_item,(条件查询+分页)列表 -->
|
|
|
- <select id="selectByCond" resultMap="BaseResultMap">
|
|
|
|
|
|
|
+ <select id="selectByCond" resultMap="BaseResultMap_Response">
|
|
|
SELECT
|
|
SELECT
|
|
|
- <include refid="Base_Column_List"/>
|
|
|
|
|
- FROM t_psi_transfer_item
|
|
|
|
|
- <include refid="Condition"/>
|
|
|
|
|
|
|
+ <include refid="Base_Column_List_Response"/>
|
|
|
|
|
+ FROM t_psi_transfer_item AS item
|
|
|
|
|
+ LEFT JOIN dkic_b.t_mst_goods_sku AS sku ON item.sku_id=sku.sku_id
|
|
|
|
|
+ LEFT JOIN dkic_b.t_psi_inventory AS inv ON inv.inv_id=item.inv_id
|
|
|
|
|
+ LEFT JOIN dkic_b.t_mst_warehouse AS wh ON wh.wh_id=inv.wh_id
|
|
|
|
|
+ LEFT JOIN dkic_b.t_psi_inventory AS oinv ON oinv.inv_id=item.o_inv_id
|
|
|
|
|
+ LEFT JOIN dkic_b.t_mst_warehouse AS owh ON owh.wh_id=item.o_wh_id
|
|
|
|
|
+ LEFT JOIN dkic_b.t_mst_goods_brand AS brand ON brand.brand_id=sku.brand_id
|
|
|
|
|
+ <include refid="Condition_Response"/>
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
</if>
|
|
@@ -148,55 +189,4 @@
|
|
|
for update
|
|
for update
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
- <!-- 根据主键锁定表t_psi_transfer_item的多行数据 -->
|
|
|
|
|
- <select id="selectByIdsForUpdate" resultMap="BaseResultMap">
|
|
|
|
|
- SELECT
|
|
|
|
|
- <include refid="Base_Column_List"/>
|
|
|
|
|
- FROM t_psi_transfer_item
|
|
|
|
|
- <include refid="idsForeach"/>
|
|
|
|
|
- for update
|
|
|
|
|
- </select>
|
|
|
|
|
-
|
|
|
|
|
- <insert id="insertBatch">
|
|
|
|
|
- insert into t_psi_transfer_item
|
|
|
|
|
- (
|
|
|
|
|
- <trim suffixOverrides=",">
|
|
|
|
|
- transfer_id,
|
|
|
|
|
- transfer_date,
|
|
|
|
|
- item_index,
|
|
|
|
|
- sku_id,
|
|
|
|
|
- o_inv_id,
|
|
|
|
|
- inv_id,
|
|
|
|
|
- o_wh_id,
|
|
|
|
|
- wh_id,
|
|
|
|
|
- o_non_std_code,
|
|
|
|
|
- non_std_code,
|
|
|
|
|
- price_into,
|
|
|
|
|
- intoing_amt,
|
|
|
|
|
- cp_id,
|
|
|
|
|
- op_app_code,
|
|
|
|
|
- </trim>
|
|
|
|
|
- )
|
|
|
|
|
- values
|
|
|
|
|
- <foreach collection="list" index="index" item="item" separator=",">
|
|
|
|
|
- (
|
|
|
|
|
- <trim suffixOverrides=",">
|
|
|
|
|
- #{item.transferId}::uuid,
|
|
|
|
|
- #{item.transferDate},
|
|
|
|
|
- #{item.itemIndex},
|
|
|
|
|
- #{item.skuId}::uuid,
|
|
|
|
|
- #{item.oInvId}::uuid,
|
|
|
|
|
- #{item.invId}::uuid,
|
|
|
|
|
- #{item.oWhId}::uuid,
|
|
|
|
|
- #{item.whId}::uuid,
|
|
|
|
|
- #{item.oNonStdCode},
|
|
|
|
|
- #{item.nonStdCode},
|
|
|
|
|
- #{item.priceInto},
|
|
|
|
|
- #{item.intoingAmt},
|
|
|
|
|
- #{item.cpId},
|
|
|
|
|
- #{item.opAppCode},
|
|
|
|
|
- </trim>
|
|
|
|
|
- )
|
|
|
|
|
- </foreach>
|
|
|
|
|
- </insert>
|
|
|
|
|
</mapper>
|
|
</mapper>
|