|
|
|
@ -5,8 +5,10 @@
|
|
|
|
|
|
|
|
|
|
<select id="filterInvProductDetail" parameterType="com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest"
|
|
|
|
|
resultType="com.glxp.sale.admin.entity.inventory.InvProductDetailEntity">
|
|
|
|
|
SELECT * FROM inv_product_detail
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM inv_product_detail
|
|
|
|
|
<where>
|
|
|
|
|
delFlag = false
|
|
|
|
|
<if test="productIdFk != '' and productIdFk != null">
|
|
|
|
|
AND productIdFk = #{productIdFk}
|
|
|
|
|
</if>
|
|
|
|
@ -51,14 +53,18 @@
|
|
|
|
|
<if test="invWarehouseCode != '' and invWarehouseCode != null">
|
|
|
|
|
AND invWarehouseCode = #{invWarehouseCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderIdFk != null and orderIdFk != ''">
|
|
|
|
|
AND orderIdFk = #{orderIdFk}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="filterJoinInvProduct" parameterType="com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest"
|
|
|
|
|
resultType="com.glxp.sale.admin.res.inventory.InvProductDetailJoinResponse">
|
|
|
|
|
SELECT inv_product_detail.* ,io_order.fromCorp,io_order.fromCorpId FROM inv_product_detail
|
|
|
|
|
inner join io_order on inv_product_detail.orderIdFk = io_order.id
|
|
|
|
|
<where>
|
|
|
|
|
inv_product_detail.delFlag = false
|
|
|
|
|
<if test="productIdFk != '' and productIdFk != null">
|
|
|
|
|
AND productIdFk = #{productIdFk}
|
|
|
|
|
</if>
|
|
|
|
@ -105,42 +111,41 @@
|
|
|
|
|
AND invWarehouseCode = #{invWarehouseCode}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertInvProductDetail" keyProperty="id"
|
|
|
|
|
parameterType="com.glxp.sale.admin.entity.inventory.InvProductDetailEntity">
|
|
|
|
|
insert INTO inv_product_detail
|
|
|
|
|
(code, productIdFk, orderIdFk, customerId, mainAction, `action`, `count`, updateTime,
|
|
|
|
|
purchaseType, batchNo, productionDate, expireDate, unitFk, stockIdFk, supId, originCode, invStorageCode,
|
|
|
|
|
invWarehouseCode)
|
|
|
|
|
(code, productIdFk, orderIdFk, customerId, mainAction, `action`, `count`, updateTime,
|
|
|
|
|
purchaseType, batchNo, productionDate, expireDate, unitFk, stockIdFk, supId, originCode,
|
|
|
|
|
invStorageCode,
|
|
|
|
|
invWarehouseCode, delFlag)
|
|
|
|
|
values (#{code},
|
|
|
|
|
#{productIdFk}, #{orderIdFk},
|
|
|
|
|
#{customerId}, #{mainAction}, #{action}, #{count}, #{updateTime},
|
|
|
|
|
#{purchaseType}, #{batchNo}, #{productionDate}, #{expireDate}, #{unitFk}, #{stockIdFk}, #{supId},
|
|
|
|
|
#{originCode}, #{invStorageCode}, #{invWarehouseCode})
|
|
|
|
|
|
|
|
|
|
#{originCode}, #{invStorageCode}, #{invWarehouseCode}, #{delFlag})
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<insert id="insertInvProductDetails" keyProperty="id"
|
|
|
|
|
parameterType="com.glxp.sale.admin.entity.inventory.InvProductDetailEntity">
|
|
|
|
|
insert INTO inv_product_detail
|
|
|
|
|
(code, productIdFk, orderIdFk, customerId, mainAction, `action`, `count`, updateTime,
|
|
|
|
|
purchaseType, batchNo, productionDate, expireDate, unitFk, stockIdFk, supId,originCode, invStorageCode,
|
|
|
|
|
invWarehouseCode)
|
|
|
|
|
values
|
|
|
|
|
(code, productIdFk, orderIdFk, customerId, mainAction, `action`, `count`, updateTime,
|
|
|
|
|
purchaseType, batchNo, productionDate, expireDate, unitFk, stockIdFk, supId, originCode,
|
|
|
|
|
invStorageCode,
|
|
|
|
|
invWarehouseCode, delFlag)
|
|
|
|
|
values
|
|
|
|
|
|
|
|
|
|
<foreach collection="invProductDetailEntitys" item="item" index="index"
|
|
|
|
|
separator=",">
|
|
|
|
|
(
|
|
|
|
|
#{item.code},
|
|
|
|
|
#{item.productIdFk},#{item.orderIdFk},
|
|
|
|
|
#{item.customerId},#{item.mainAction},#{item.action},#{item.count},#{item.updateTime},
|
|
|
|
|
#{item.purchaseType}, #{item.batchNo}, #{item.productionDate}, #{item.expireDate},
|
|
|
|
|
#{item.unitFk},#{item.stockIdFk}
|
|
|
|
|
,#{item.supId},#{item.originCode},#{item.invStorageCode},#{item.invWarehouseCode}
|
|
|
|
|
)
|
|
|
|
|
(#{item.code},
|
|
|
|
|
#{item.productIdFk}, #{item.orderIdFk},
|
|
|
|
|
#{item.customerId}, #{item.mainAction}, #{item.action}, #{item.count}, #{item.updateTime},
|
|
|
|
|
#{item.purchaseType}, #{item.batchNo}, #{item.productionDate}, #{item.expireDate},
|
|
|
|
|
#{item.unitFk}, #{item.stockIdFk},
|
|
|
|
|
#{item.supId}, #{item.originCode}, #{item.invStorageCode}, #{item.invWarehouseCode},
|
|
|
|
|
#{item.delFlag})
|
|
|
|
|
</foreach>
|
|
|
|
|
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -190,6 +195,7 @@
|
|
|
|
|
<if test="originCode != null">originCode=#{originCode},</if>
|
|
|
|
|
<if test="invStorageCode != null">invStorageCode=#{invStorageCode},</if>
|
|
|
|
|
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
|
|
|
|
|
<if test="delFlag != null">delFlag=#{delFlag},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
WHERE id = #{id}
|
|
|
|
|
</update>
|
|
|
|
@ -197,6 +203,7 @@
|
|
|
|
|
resultType="java.lang.Integer">
|
|
|
|
|
SELECT count(0) FROM inv_product_detail
|
|
|
|
|
<where>
|
|
|
|
|
delFlag = false
|
|
|
|
|
<if test="productIdFk != '' and productIdFk != null">
|
|
|
|
|
AND productIdFk = #{productIdFk}
|
|
|
|
|
</if>
|
|
|
|
@ -246,6 +253,7 @@
|
|
|
|
|
resultType="com.glxp.sale.admin.entity.inventory.InvProductDetailEntity">
|
|
|
|
|
SELECT * FROM inv_product_detail
|
|
|
|
|
<where>
|
|
|
|
|
delFlag = false
|
|
|
|
|
<if test="productIdFk != '' and productIdFk != null">
|
|
|
|
|
AND productIdFk = #{productIdFk}
|
|
|
|
|
</if>
|
|
|
|
@ -283,4 +291,11 @@
|
|
|
|
|
limit 1
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<update id="updateDelFlag">
|
|
|
|
|
update inv_product_detail
|
|
|
|
|
set delFlag = #{delFlag}
|
|
|
|
|
where orderIdFk = #{orderIdFk}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
</mapper>
|