|
|
@@ -479,13 +479,6 @@
|
|
|
produc_date, scrq, wllb_class, produc_batch, attribute, serial, supplier_id,
|
|
|
wllb_code, totime)
|
|
|
value (#{storageLocationCode},#{materialId},#{warehousingNum},'0','0',#{companyNumber},#{wbs},#{producBatch},now(),#{wllbClass},#{producBatch},#{attribute},#{serial},#{supplierId},#{wllbCode},now());
|
|
|
- update tld_notice
|
|
|
- set warehousing_num = #{warehousingNum}
|
|
|
- <if test="type != null and type != ''">
|
|
|
- ,type = '1'
|
|
|
- </if>
|
|
|
- where notice_id = #{noticeId}
|
|
|
- and material_id = #{materialId}
|
|
|
</insert>
|
|
|
<!-- 查询库存里是否存在半成品虚拟库位 -->
|
|
|
<select id="getInventoryNotice" resultType="int">
|
|
|
@@ -504,11 +497,6 @@
|
|
|
where storage_location_code = #{storageLocationCode}
|
|
|
and material_id = #{materialId}
|
|
|
and wbs = #{wbs};
|
|
|
- update tld_notice
|
|
|
- set warehousing_num = #{warehousingNum},
|
|
|
- type = '1'
|
|
|
- where notice_id = #{noticeId}
|
|
|
- and material_id = #{materialId}
|
|
|
</update>
|
|
|
<!-- 半成品出库库存查询 -->
|
|
|
<select id="getHalfInventory" resultType="com.tld.model.Inventory">
|
|
|
@@ -856,6 +844,9 @@
|
|
|
<update id="updateNotice">
|
|
|
update tld_notice
|
|
|
set warehousing_num = (warehousing_num + 0) + #{warehousingNum}
|
|
|
+ <if test="type != null and type != ''">
|
|
|
+ ,type = '1'
|
|
|
+ </if>
|
|
|
where notice_id = #{noticeId}
|
|
|
and material_id = #{materialId}
|
|
|
</update>
|
|
|
@@ -879,7 +870,7 @@
|
|
|
<select id="getStorageLocationCode" resultType="String">
|
|
|
SELECT ifnull(max(storage_location_code), "0")
|
|
|
FROM tld_inventory
|
|
|
- WHERE attribute = #{attribute} and scrq <![CDATA[${symbol}]]> CURDATE()
|
|
|
+ WHERE attribute = #{attribute} and DATE_FORMAT(scrq,'%Y-%m-%d') <![CDATA[${symbol}]]> CURDATE() and material_id = #{materialId}
|
|
|
<if test="producBatch != null">
|
|
|
and produc_batch = #{producBatch}
|
|
|
</if>
|
|
|
@@ -890,9 +881,10 @@
|
|
|
FROM tld_inventory
|
|
|
where attribute = #{attribute}
|
|
|
and storage_location_code = #{storageLocationCode}
|
|
|
- and scrq <![CDATA[${symbol}]]> CURDATE()
|
|
|
+ and DATE_FORMAT(scrq,'%Y-%m-%d') <![CDATA[${symbol}]]> CURDATE()
|
|
|
+ and material_id = #{materialId}
|
|
|
<if test="producBatch != null">
|
|
|
- produc_batch = #{producBatch}
|
|
|
+ and produc_batch = #{producBatch}
|
|
|
</if>
|
|
|
ORDER BY scrq desc LIMIT 1
|
|
|
</select>
|