@ -3,6 +3,7 @@ package com.op.device.mapper;
import java.math.BigDecimal;
import java.util.List;
import com.op.device.domain.EquSpareApply;
import com.op.device.domain.SparePartsLedger;
/**
@ -67,4 +68,9 @@ public interface SparePartsLedgerMapper {
*/
BigDecimal selectRealAmountByMaterialCode(String materialCode);
* 减少库存数量
* @param apply
void updateSpareNumReduce(EquSpareApply apply);
}
@ -280,6 +280,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where storage_id = #{storageId}
</update>
<update id="updateSpareNumReduce">
update wms_ods_mate_storage_news
set amount = ( amount - #{spareQuantity} ) where material_code = #{spareCode}
<delete id="deleteSparePartsLedgerByStorageId" parameterType="String">
delete from wms_ods_mate_storage_news where storage_id = #{storageId}
</delete>