|
|
@@ -37,7 +37,8 @@
|
|
|
select
|
|
|
DISTINCT a.ask_goods_id,
|
|
|
a.ask_goods_code,
|
|
|
- b.name as departmentName
|
|
|
+ b.name as departmentName,
|
|
|
+ a.company_number
|
|
|
from tld_ask_goods_f a
|
|
|
join tld_ask_goods d on a.ask_goods_id = d.ask_goods_id
|
|
|
left join tld_department b on a.department = b.tld_id
|
|
|
@@ -82,12 +83,12 @@
|
|
|
b.storage_location_name as storageLocationName
|
|
|
from tld_inventory a
|
|
|
join tld_storage_location b on a.storage_location_code = b.storage_location_code
|
|
|
- where a.material_id = #{materialId} and a.hold = '0' and b.warehouse_where != '5000' order by a.produc_date
|
|
|
+ where a.material_id = #{materialId} and a.account_sleeve = #{companyNumber} and a.hold = '0' and b.warehouse_where != '5000' order by a.produc_date
|
|
|
</select>
|
|
|
<!-- 新增出库虚拟表 -->
|
|
|
<insert id="addAskGoodsVitrual">
|
|
|
- insert into tld_ask_goods_vitrual(unique_code,supplier_id,serial,wllb_code,produc_date,ask_goods_id,type,storage_location_code,num,user_id,department,attribute)
|
|
|
- values(#{uniqueCode},#{supplierId},#{serial},#{wllbCode},#{producDate},#{askGoodsId},#{type},#{storageLocationCode},#{num},#{userId},#{department},#{attribute})
|
|
|
+ insert into tld_ask_goods_vitrual(unique_code,supplier_id,serial,wllb_code,produc_date,ask_goods_id,type,storage_location_code,num,user_id,department,attribute,account_sleeve)
|
|
|
+ values(#{uniqueCode},#{supplierId},#{serial},#{wllbCode},#{producDate},#{askGoodsId},#{type},#{storageLocationCode},#{num},#{userId},#{department},#{attribute},#{companyNumber})
|
|
|
</insert>
|
|
|
<!-- 查询指定库存内容 -->
|
|
|
<select id="getInventory" resultType="com.tld.model.Inventory">
|
|
|
@@ -186,8 +187,8 @@
|
|
|
</delete>
|
|
|
<!-- 插入出库流水 -->
|
|
|
<insert id="addRemoval">
|
|
|
- insert into tld_removal(wllb_code,supplier_id,serial,num,type,user_id,storage_location_code,scrq,process,ask_goods_id,produc_date,department)
|
|
|
- values(#{wllbCode},#{supplierId},#{serial},#{num},#{type},#{userId},#{storageLocationCode},now(),#{process},#{askGoodsId},#{producDate},#{department})
|
|
|
+ insert into tld_removal(wllb_code,supplier_id,serial,num,type,user_id,storage_location_code,scrq,process,ask_goods_id,produc_date,department,storage_code)
|
|
|
+ values(#{wllbCode},#{supplierId},#{serial},#{num},#{type},#{userId},#{storageLocationCode},now(),#{process},#{askGoodsId},#{producDate},#{department},#{storageCode})
|
|
|
</insert>
|
|
|
<!-- 查询指定物料类型的id -->
|
|
|
<select id="getMaterialId" resultType="String">
|
|
|
@@ -357,7 +358,7 @@
|
|
|
<select id="getScanNum" resultType="String">
|
|
|
select if(AVG(num) is null, 0, num)
|
|
|
from tld_ask_goods_vitrual
|
|
|
- where unique_code = #{uniqueCode} and ask_goods_id = #{askGoodsId}
|
|
|
+ where unique_code = #{uniqueCode} and ask_goods_id = #{askGoodsId} and wllb_code = #{wllbCode}
|
|
|
</select>
|
|
|
<!-- 查询半成品出库数据 -->
|
|
|
<select id="getGoodsHalf" resultType="com.tld.model.AskGoods">
|
|
|
@@ -403,7 +404,8 @@
|
|
|
a.ask_goods_id,
|
|
|
c.name as department,
|
|
|
b.name as materialName,
|
|
|
- e.user_name as userName
|
|
|
+ e.user_name as userName,
|
|
|
+ b.code as materialCode
|
|
|
from tld_removal_half_product a
|
|
|
left join tld_material b on a.wllb_code = b.code
|
|
|
left join tld_department c on a.department = c.tld_id
|
|
|
@@ -457,7 +459,8 @@
|
|
|
b.name as materialName,
|
|
|
c.user_name as userName,
|
|
|
e.name as customerName,
|
|
|
- f.name as companyName
|
|
|
+ f.name as companyName,
|
|
|
+ b.code as materialCode
|
|
|
from tld_removal_half a
|
|
|
left join tld_material b on a.wllb_code = b.code
|
|
|
left join tld_user c on a.user_id = c.id
|
|
|
@@ -521,7 +524,7 @@
|
|
|
scrq,
|
|
|
produc_batch,
|
|
|
attribute
|
|
|
- from tld_inventory where storage_location_code = #{storageLocationCode} and material_id = #{materialId} and amount <![CDATA[>=]]> #{num}
|
|
|
+ from tld_inventory where storage_location_code = #{storageLocationCode} and material_id = #{materialId} and account_sleeve = #{accountSleeve} and amount <![CDATA[>=]]> #{num}
|
|
|
<if test="wbs != '' and wbs != null">
|
|
|
and wbs = #{wbs}
|
|
|
</if>
|