select
a.id,
a.warehouse_transfer_id,
a.entry_number,
a.supply_warehouse_id,
a.material_id,
a.wbs,
a.num,
a.out_num,
a.type,
a.account_sleeve,
b.warehouse_transfer_code,
b.ask_goods_warehouse_id,
b.document_time,
b.warehouse_transfer_type,
c.name as materialName,
c.code as materialCode,
c.part_type as partType,
c.is_recommend as isRecommend,
f.name as askGoodsWarehouseaName,
e.name as supplyWarehouseName,
ifnull(f.warehouse_type, 10) as askType,
ifnull(e.warehouse_type, 10) as suppType
from tld_warehouse_transfer a
join tld_warehouse_transfer_f b on a.warehouse_transfer_id = b.warehouse_transfer_id
join tld_material c on a.material_id = c.tld_id
join tld_warehouse e on a.supply_warehouse_id = e.tld_id
join tld_warehouse f on b.ask_goods_warehouse_id = f.tld_id
and a.type = #{type}
and c.code like CONCAT(CONCAT('%', #{materialCode}), '%')
and c.name like CONCAT(CONCAT('%', #{materialName}), '%')
and a.document_time =]]> #{startTime}
and a.document_time #{endTime}
and (a.num + 0) ]]> (a.out_num + 0)
select
a.storage_location_code,
a.wllb_class,
a.library_type,
a.material_id,
(a.amount - ifnull(a.amount_lock, 0)) as amount,
a.total,
a.totime,
a.hold,
a.amount_lock,
a.account_sleeve,
a.wbs,
a.supplier_id,
a.serial,
a.wllb_code,
a.produc_date,
a.scrq,
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 a.account_sleeve = #{accountSleeve} and a.wbs = #{wbs} and b.warehouse_where = #{warehouseWhere}
order by a.produc_date
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}
select
a.id,
a.warehouse_transfer_id,
a.entry_number,
a.supply_warehouse_id,
a.material_id,
a.wbs,
a.measurement_id,
a.num,
a.out_num,
a.type,
a.account_sleeve,
b.ask_goods_warehouse_id
from tld_warehouse_transfer a
join tld_warehouse_transfer_f b on a.warehouse_transfer_id = b.warehouse_transfer_id
where a.warehouse_transfer_id = #{askGoodsId} and a.material_id = #{materialId}
update tld_warehouse_transfer
set out_num = ifnull(out_num, 0) + #{num},type = #{typeVal} where material_id = #{materialId} and warehouse_transfer_id = #{askGoodsId}
select count(*) from tld_return_warehouse_transfer where scrq BETWEEN CONCAT(CURDATE(),' 00:00:00') AND CONCAT(CURDATE(),' 23:59:59');
insert into tld_return_warehouse_transfer_z(warehouse_transfer_id,entry_number,supply_warehouse_id,material_id,wbs,out_num)
value(#{warehouseTransferId},#{entryNumber},#{supplyWarehouseId},#{materialId},#{wbs},#{outNum})
select
warehouse_transfer_id,
warehouse_transfer_code,
ask_goods_warehouse_id,
warehouse_transfer_type,
document_time
from tld_warehouse_transfer_f where warehouse_transfer_id = #{askGoodsId}
select * from tld_warehouse_transfer where id = #{id}
delete from tld_warehouse_transfer where id = #{id}
insert into tld_return_warehouse_transfer(warehouse_transfer_id,warehouse_transfer_code,ask_goods_warehouse_id,warehouse_transfer_type,scrq)
value(#{warehouseTransferId},#{warehouseTransferCode},#{askGoodsWarehouseId},#{warehouseTransferType},now())
select if(sum(num) is null, 0, sum(num))
from tld_warehousing_virtual
where unique_code = #{uniqueCode} and warehouse_transfer_id = #{warehouseTransferId} and wllb_code = #{materialCode}
select if(sum(num) is null, 0, sum(num))
from tld_ask_goods_vitrual
where unique_code = #{uniqueCode} and ask_goods_id = #{warehouseTransferId} and wllb_code = #{materialCode}
SELECT
a.id,
a.warehouse_transfer_id,
a.entry_number,
a.material_id,
a.wbs,
a.measurement_id,
a.num,
ifnull(a.out_num, 0) as out_num
FROM
tld_warehouse_transfer a
join tld_material b on a.material_id = b.tld_id
where a.warehouse_transfer_id = #{askGoodsId} and b.code = #{wllbCode}
select
a.storage_location_code,
a.wllb_class,
a.library_type,
a.material_id,
(a.amount - ifnull(a.amount_lock, 0)) as amount,
a.total,
a.totime,
a.hold,
a.amount_lock,
a.account_sleeve,
a.wbs,
a.supplier_id,
a.serial,
a.wllb_code,
a.produc_date,
a.scrq,
b.storage_location_name as storageLocationName
from tld_inventory a
join tld_storage_location b on a.storage_location_code = b.storage_location_code
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}
and c.tld_id = #{warehouseWhere}
order by a.produc_batch
select
id,
storage_location_code,
wllb_class,
library_type,
material_id,
amount,
total,
totime,
hold,
amount_lock,
account_sleeve,
wbs,
supplier_id,
serial,
wllb_code,
produc_date,
scrq
from tld_inventory where storage_location_code = #{storageLocationCodeRk} and material_id = #{materialId}
and account_sleeve = #{accountSleeve}
and wbs = #{wbs}
SELECT
ifnull(warehouse_type, "10") as warehouseType
FROM
tld_warehouse
WHERE
tld_id = #{askGoodsWarehouseId}