|
@@ -16,6 +16,7 @@
|
|
|
a.out_num,
|
|
|
b.company_number,
|
|
|
b.bills_time,
|
|
|
+ b.customer_code,
|
|
|
b.delivery_type,
|
|
|
b.source_type,
|
|
|
b.move_type,
|
|
@@ -55,7 +56,8 @@
|
|
|
a.scrq,
|
|
|
a.produc_batch,
|
|
|
a.attribute,
|
|
|
- b.storage_location_name as storageLocationName
|
|
|
+ b.storage_location_name as storageLocationName,
|
|
|
+ a.account_sleeve
|
|
|
FROM tld_inventory a
|
|
|
LEFT JOIN tld_storage_location b on a.storage_location_code = b.storage_location_code
|
|
|
WHERE #{storageLocationCode} LIKE CONCAT( '%', CONCAT( a.storage_location_code, ',' ), '%' )
|
|
@@ -67,7 +69,7 @@
|
|
|
a.produc_batch
|
|
|
</select>
|
|
|
<!-- 查询指定库存内容 -->
|
|
|
- <select id="getInventoryHalf" resultType="com.tld.model.AskGoods">
|
|
|
+ <select id="getInventoryHalf" resultType="com.tld.model.Inventory">
|
|
|
SELECT
|
|
|
a.id,
|
|
|
a.storage_location_code,
|
|
@@ -82,8 +84,7 @@
|
|
|
a.produc_date,
|
|
|
a.scrq,
|
|
|
a.produc_batch,
|
|
|
- a.attribute,
|
|
|
- b.storage_location_name as storageLocationName
|
|
|
+ a.attribute
|
|
|
FROM tld_inventory a
|
|
|
JOIN tld_material b on a.material_id = b.tld_id
|
|
|
WHERE b.code = #{wllbCode} and a.account_sleeve = #{companyNumber} and a.wbs = #{wbs}
|
|
@@ -107,7 +108,7 @@
|
|
|
</select>
|
|
|
<!-- 修改销售单出库数量 -->
|
|
|
<update id="updateDelivery">
|
|
|
- update tld_delivery set ifnull(out_num, 0) = #{num} where delivery_id = #{deliveryId} and material_id = #{materialId}
|
|
|
+ update tld_delivery set out_num = (out_num + 0) + #{num} where delivery_id = #{deliveryId} and material_id = #{materialId}
|
|
|
</update>
|
|
|
<!-- 产成品出库流水 -->
|
|
|
<insert id="addRemovalHalf">
|
|
@@ -239,4 +240,9 @@
|
|
|
WHERE
|
|
|
a.ask_goods_id = #{deliveryId} and b.tld_id = #{materialId}
|
|
|
</select>
|
|
|
+ <!-- 新增半成品流水 -->
|
|
|
+ <insert id="addRemovalHalfProduct">
|
|
|
+ insert into tld_removal_half_product(wllb_code,num,user_id,scrq,ask_goods_id,storage_code,wbs,company_number)
|
|
|
+ value(#{materialCode},#{outNum},#{userId},now(),#{deliveryId},#{storageCode},#{wbs},#{companyNumber})
|
|
|
+ </insert>
|
|
|
</mapper>
|