瀏覽代碼

问题修改

zhs 2 年之前
父節點
當前提交
3eaaa0bd4b

+ 1 - 1
src/main/resources/mapper/AskGoodsMapper.xml

@@ -372,7 +372,7 @@
     <!-- 修改出库数量 -->
     <update id="updateOutNum">
         update tld_ask_goods
-        set out_num = out_num + #{num} where material_id = #{materialId} and ask_goods_id = #{askGoodsId}
+        set out_num = ifnull(out_num, 0) + #{num} where material_id = #{materialId} and ask_goods_id = #{askGoodsId}
     </update>
     <!-- 查询指定pda 指定物料扫描总数 -->
     <select id="getScanNum" resultType="String">

+ 1 - 1
src/main/resources/mapper/DeliveryMapper.xml

@@ -94,7 +94,7 @@
     </select>
     <!-- 修改销售单出库数量 -->
     <update id="updateDelivery">
-        update tld_delivery set out_num = #{num} where delivery_id = #{deliveryId} and material_id = #{materialId}
+        update tld_delivery set ifnull(out_num, 0) = #{num} where delivery_id = #{deliveryId} and material_id = #{materialId}
     </update>
     <!-- 产成品出库流水 -->
     <insert id="addRemovalHalf">

+ 1 - 1
src/main/resources/mapper/InviteMapper.xml

@@ -426,6 +426,6 @@
     <!-- 修改出库数量 -->
     <update id="updateOutNum">
         update tld_invite
-        set out_num = out_num + #{num} where material_id = #{materialId} and ask_goods_id = #{askGoodsId}
+        set ifnull(out_num, 0) = out_num + #{num} where material_id = #{materialId} and ask_goods_id = #{askGoodsId}
     </update>
 </mapper>

+ 1 - 1
src/main/resources/mapper/WarehouseTransferMapper.xml

@@ -74,7 +74,7 @@
     <!-- 修改出库数量 -->
     <update id="updateOutNum">
         update tld_warehouse_transfer
-        set out_num = out_num + #{num},type = '1' where material_id = #{materialId} and warehouse_transfer_id = #{askGoodsId}
+        set out_num = ifnull(out_num, 0) + #{num},type = '1' where material_id = #{materialId} and warehouse_transfer_id = #{askGoodsId}
     </update>
     <!-- 查询当天移库单条数 -->
     <select id="getReturnWarehouseTransferCount" resultType="int">

+ 1 - 1
src/main/resources/mapper/WarehousingMapper.xml

@@ -475,7 +475,7 @@
     </select>
     <!-- 修改要货单出库数量 -->
     <update id="updateAskGoodsHalf">
-        update tld_ask_goods set out_num = out_num + #{warehousingNum},type = '1' where id = #{id}
+        update tld_ask_goods set ifnull(out_num, 0) = out_num + #{warehousingNum},type = '1' where id = #{id}
     </update>
     <!-- 新增半成品流水 -->
     <insert id="addRemovalHalfProduct">