|
@@ -109,7 +109,13 @@
|
|
|
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.account_sleeve = #{companyNumber} and a.hold = '0' and b.warehouse_where != '5000' order by a.produc_batch
|
|
|
+ join tld_warehouse c on b.warehouse_where = c.tld_id
|
|
|
+ where a.material_id = #{materialId}
|
|
|
+ and a.account_sleeve = #{companyNumber}
|
|
|
+ and a.hold = '0'
|
|
|
+ and (c.warehouse_type = '0' or c.warehouse_type = '1' or c.warehouse_type = '2')
|
|
|
+ and a.wbs = #{wbs}
|
|
|
+ order by a.produc_batch
|
|
|
</select>
|
|
|
<!-- 新增出库虚拟表 -->
|
|
|
<insert id="addAskGoodsVitrual">
|
|
@@ -152,21 +158,20 @@
|
|
|
</select>
|
|
|
<!-- 查询库存是否充足 -->
|
|
|
<select id="getAsk" resultType="com.tld.model.AskGoods">
|
|
|
- SELECT
|
|
|
- ifnull(sum(a.num),0) as num
|
|
|
- FROM
|
|
|
- tld_ask_goods_vitrual a
|
|
|
- join tld_material b on a.wllb_code = b.code and b.tld_id = #{materialId}
|
|
|
+ SELECT ifnull(sum(a.num), 0) as num
|
|
|
+ FROM tld_ask_goods_vitrual a
|
|
|
+ join tld_material b on a.wllb_code = b.code and b.tld_id = #{materialId}
|
|
|
where a.storage_location_code = #{storageLocationCode}
|
|
|
+ and a.serial = #{serial} and wbs = #{wbs} and account_sleeve = #{accountSleeve}
|
|
|
</select>
|
|
|
<!-- 查询是否扫描 -->
|
|
|
<select id="getScanIsNot" resultType="java.util.Map">
|
|
|
- select (select ifnull(amount, 0)
|
|
|
+ select (select ifnull(max(amount), 0)
|
|
|
from tld_inventory
|
|
|
where supplier_id = #{supplierId}
|
|
|
and serial = #{serial}
|
|
|
and wllb_code = #{wllbCode}
|
|
|
- and produc_batch = #{producDate}) as inventoryNum,
|
|
|
+ and produc_date = #{producDate}) as inventoryNum,
|
|
|
(select ifnull(sum(num), 0)
|
|
|
from tld_ask_goods_vitrual
|
|
|
where supplier_id = #{supplierId}
|