SELECT
a.id as id,
a.material_id as materialId,
a.amount as amount,
a.scrq as scrq,
a.storage_location_code as storageLocationCode,
b.name as materialName,
c.storage_location_name as storageLocationName,
b.code as wllbCode,
a.wbs as wbs,
e.name as ustomerName,
a.account_sleeve as accountSleeve,
f.name as companyName
FROM tld_inventory a
JOIN tld_material b ON a.material_id = b.tld_id
LEFT JOIN tld_storage_location c ON a.storage_location_code = c.storage_location_code
LEFT JOIN tld_customer e ON a.supplier_id = e.code
LEFT JOIN tld_company f ON a.account_sleeve = f.code
WHERE datediff(now(), a.scrq) ]]> 90
and a.storage_location_code = #{storageLocationCode}
and b.name like CONCAT(CONCAT('%', #{materialName}), '%')
and b.code like CONCAT(CONCAT('%', #{wllbCode}), '%')
and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
and c.storage_location_name like CONCAT(CONCAT('%', #{storageLocationName}), '%')
and a.supplier_id = #{ustomerCode}
and a.account_sleeve = #{companyCode}
select
tld_id as tldId,
ifnull(min_num, 0) as minNum,
ifnull(max_num, 0) as maxNum,
name as name,
code as code
from tld_material
and code like CONCAT(CONCAT('%', #{wllbCode}), '%')
and name like CONCAT(CONCAT('%', #{materialName}), '%')
SELECT ifnull(sum(a.amount), "0") as amount,
${tldId} as materialId,
${minNum} as minNum,
${maxNum} as maxNum
FROM tld_inventory a
LEFT JOIN tld_material b ON a.material_id = b.tld_id
WHERE material_id = #{tldId}
SELECT
a.id,
YEAR(CURDATE()) AS year,
MONTH(CURDATE()) AS month,
f.code as warehouseCode,
f.name as warehouseName,
b.storage_location_name as storageLocationName,
c.code as code,
c.name as name,
m.name as unitOfMeasurement,
sum( a.amount ) AS sum,
a.wbs as wbs,
c.max_num as maxNum,
DATEDIFF(now(), scrq) as day,
c.part_type as partType,
c.wllb_class as wllbClass,
p.code as companyCode,
p.name as companyName,
a.account_sleeve as accountSleeve,
a.supplier_id as supplierId,
e.name as supplierName,
a.storage_location_code as storageLocationCode
FROM
tld_inventory a
LEFT JOIN tld_storage_location b ON a.storage_location_code = b.storage_location_code
LEFT JOIN tld_material c ON a.material_id = c.tld_id
LEFT JOIN tld_customer e ON a.supplier_id = e.code
LEFT JOIN tld_warehouse f on b.warehouse_where = f.tld_id
LEFT JOIN tld_company p on a.account_sleeve = p.code
LEFT JOIN tld_measurement m on c.unit_of_measurement = m.tld_id
and a.storage_location_code = #{storageLocationCode}
and a.material_id = #{materialId}
and c.code like CONCAT(CONCAT('%', #{wllbCode}), '%')
and c.name like CONCAT(CONCAT('%', #{materialName}), '%')
and b.storage_location_name like CONCAT(CONCAT('%', #{storageLocationName}), '%')
and p.name like CONCAT(CONCAT('%', #{companyName}), '%')
and p.code = #{companyCode}
and a.supplier_id like CONCAT(CONCAT('%', #{supplierId}), '%')
and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
and f.tld_id = #{warehouseId}
and c.part_type = #{partType}
and c.wllb_class = #{wllbClass}
and c.unit_of_measurement = #{unitOfMeasurement}
GROUP BY
${groupBy}
SELECT
a.id,
a.storage_location_code as storageLocationCode,
a.material_id as materialId,
a.amount AS sum,
a.serial,
a.produc_batch as producBatch,
a.supplier_id as supplierId,
b.storage_location_name as storageLocationName ,
b.warehouse_where as warehouseWhere,
b.storage_location_type as storageLocationType,
b.storage_location_capacity as storageLocationCapacity,
b.is_not_disable as isNotDisable,
b.create_time as createTime,
b.is_product as isProduct,
c.name as name,
c.code as code,
e.name as supplierName,
a.wbs,
a.account_sleeve
FROM tld_inventory a
LEFT JOIN tld_storage_location b ON a.storage_location_code = b.storage_location_code
LEFT JOIN tld_material c ON a.material_id = c.tld_id
LEFT JOIN tld_customer e ON a.supplier_id = e.code
and a.storage_location_code = #{storageLocationCode}
and a.material_id = #{materialId}
and a.wbs = #{wbs}
and a.account_sleeve = #{companyCode}
and (a.amount + 0) ]]> #{amount}
SELECT
YEAR(CURDATE()) AS year,
MONTH(CURDATE()) AS month,
f.code as warehouseCode,
f.name as warehouseName,
b.storage_location_name as storageLocationName,
c.code as code,
c.name as name,
ifnull(c.unit_of_measurement, "暂无单位") as unit_of_measurement,
sum( a.amount ) AS sum,
if(a.wbs = "", " ", a.wbs) as wbs,
ifnull(c.max_num, 0) as max_num,
DATEDIFF(now(),scrq) as day,
ifnull(c.part_type, "暂无分类") as part_type,
ifnull(c.wllb_class, "暂无分类") as wllb_class,
p.code as companyCode,
p.name as companyName
FROM tld_inventory a
LEFT JOIN tld_storage_location b ON a.storage_location_code = b.storage_location_code
LEFT JOIN tld_material c ON a.material_id = c.tld_id
LEFT JOIN tld_customer e ON a.supplier_id = e.code
LEFT JOIN tld_warehouse f on b.warehouse_where = f.tld_id
LEFT JOIN tld_company p on a.account_sleeve = p.code
and a.storage_location_code = #{storageLocationCode}
and a.material_id = #{materialId}
and c.code like CONCAT(CONCAT('%', #{wllbCode}), '%')
and c.name like CONCAT(CONCAT('%', #{materialName}), '%')
and b.storage_location_name like CONCAT(CONCAT('%', #{storageLocationName}), '%')
and p.name like CONCAT(CONCAT('%', #{companyName}), '%')
and a.supplier_id like CONCAT(CONCAT('%', #{supplierId}), '%')
and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
and f.tld_id = #{warehouseId}
GROUP BY
/*a.storage_location_code,
a.material_id,
a.wbs,
a.account_sleeve*/
${groupBy}
select id,type,data,scrq,access_type from tld_access
and type = #{type}
and access_type = #{accessType}
and data like CONCAT(CONCAT('%', #{data}), '%')
and scrq =]]> #{startTime}
and scrq #{endTime}
order by id desc
SELECT
a.id,
a.ask_goods_id,
a.material_id,
IFNULL( a.out_num, 0 ) AS out_num,
a.num,
e.NAME AS materialName,
e.CODE AS materialCode,
b.ask_goods_code,
b.company_number,
b.sqrq,
c.name as departmentName,
g.name as companyName,
b.source_type,
b.move_type,
a.entry_number,
a.production_code,
a.wbs
FROM
tld_ask_goods a
JOIN tld_ask_goods_f b ON a.ask_goods_id = b.ask_goods_id
LEFT JOIN tld_department c ON b.department = c.code
JOIN tld_material e ON a.material_id = e.tld_id
left join tld_company g on b.company_number = g.code
/* WHERE e.part_type != '半成品' and e.part_type != '产成品'*/
and e.code like CONCAT(CONCAT('%', #{materialCode}), '%')
and e.name like CONCAT(CONCAT('%', #{materialName}), '%')
and b.sqrq =]]> #{startTime}
and b.sqrq #{endTime}
and b.department = #{departmentCode}
and b.company_number = #{companyCode}
and b.source_type like CONCAT(CONCAT('%', #{sourceType}), '%')
and b.move_type like CONCAT(CONCAT('%', #{moveType}), '%')
and a.entry_number like CONCAT(CONCAT('%', #{entryNumber}), '%')
and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
and b.ask_goods_code like CONCAT(CONCAT('%', #{askGoodsCode}), '%')
and a.production_code like CONCAT(CONCAT('%', #{productionCode}), '%')
order by a.id desc
SELECT
a.ask_goods_id,
a.material_id,
a.num,
IFNULL( a.out_num, 0 ) AS out_num,
e.NAME AS materialName,
e.CODE AS materialCode,
b.ask_goods_code,
a.wbs,
b.company_number,
g.name as companyName
FROM
tld_ask_goods a
JOIN tld_ask_goods_f b ON a.ask_goods_id = b.ask_goods_id
LEFT JOIN tld_department c ON b.department = c.code
JOIN tld_material e ON a.material_id = e.tld_id
left join tld_company g on b.company_number = g.code
/*WHERE e.part_type != '半成品' and e.part_type != '产成品'*/
and e.code like CONCAT(CONCAT('%', #{materialCode}), '%')
and e.name like CONCAT(CONCAT('%', #{materialName}), '%')
and b.sqrq =]]> #{startTime}
and b.sqrq #{endTime}
and b.department = #{departmentCode}
and b.company_number = #{companyCode}
and b.source_type like CONCAT(CONCAT('%', #{sourceType}), '%')
and b.move_type like CONCAT(CONCAT('%', #{moveType}), '%')
and a.entry_number like CONCAT(CONCAT('%', #{entryNumber}), '%')
and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
and b.ask_goods_code like CONCAT(CONCAT('%', #{askGoodsCode}), '%')
and a.production_code like CONCAT(CONCAT('%', #{productionCode}), '%')
order by a.id desc
SELECT
a.id,
a.ask_goods_id,
a.material_id,
IFNULL( a.out_num, 0 ) AS out_num,
a.num,
e.NAME AS materialName,
e.CODE AS materialCode,
b.ask_goods_code,
b.company_number,
b.sqrq,
c.name as departmentName,
g.name as companyName,
b.source_type ,
b.move_type ,
a.entry_number,
a.production_code,
a.wbs
FROM
tld_invite a
JOIN tld_invite_f b ON a.ask_goods_id = b.ask_goods_id
LEFT JOIN tld_department c ON b.department = c.code
JOIN tld_material e ON a.material_id = e.tld_id
left join tld_company g on b.company_number = g.code
/*WHERE*/
/*e.part_type != '半成品' and e.part_type != '产成品'*/
and e.code like CONCAT(CONCAT('%', #{materialCode}), '%')
and e.name like CONCAT(CONCAT('%', #{materialName}), '%')
and b.sqrq =]]> #{startTime}
and b.sqrq #{endTime}
and b.department = #{departmentCode}
and b.company_number = #{companyCode}
and b.source_type like CONCAT(CONCAT('%', #{sourceType}), '%')
and b.move_type like CONCAT(CONCAT('%', #{moveType}), '%')
and a.entry_number like CONCAT(CONCAT('%', #{entryNumber}), '%')
and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
and b.ask_goods_code like CONCAT(CONCAT('%', #{askGoodsCode}), '%')
and a.production_code like CONCAT(CONCAT('%', #{productionCode}), '%')
order by a.id desc
SELECT
a.ask_goods_id,
a.material_id,
a.num,
IFNULL( a.out_num, 0 ) AS out_num,
e.NAME AS materialName,
e.CODE AS materialCode,
b.ask_goods_code,
a.wbs,
b.company_number,
g.name as companyName
FROM
tld_invite a
JOIN tld_invite_f b ON a.ask_goods_id = b.ask_goods_id
LEFT JOIN tld_department c ON b.department = c.code
JOIN tld_material e ON a.material_id = e.tld_id
left join tld_company g on b.company_number = g.code
/*WHERE e.part_type != '半成品' and e.part_type != '产成品'*/
and e.code like CONCAT(CONCAT('%', #{materialCode}), '%')
and e.name like CONCAT(CONCAT('%', #{materialName}), '%')
and b.sqrq =]]> #{startTime}
and b.sqrq #{endTime}
and b.department = #{departmentCode}
and b.company_number = #{companyCode}
and b.source_type like CONCAT(CONCAT('%', #{sourceType}), '%')
and b.move_type like CONCAT(CONCAT('%', #{moveType}), '%')
and a.entry_number like CONCAT(CONCAT('%', #{entryNumber}), '%')
and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
and b.ask_goods_code like CONCAT(CONCAT('%', #{askGoodsCode}), '%')
and a.production_code like CONCAT(CONCAT('%', #{productionCode}), '%')
order by a.id desc
select
a.id,
a.delivery_id,
a.material_id,
a.wbs,
a.gs_delivery_num,
a.gs_cancel_num,
ifnull(a.out_num, 0) as out_num,
b.company_number,
b.bills_time,
c.name as materialName,
c.code as materialCode,
g.name as customerName,
b.delivery_code as deliveryCode,
v.name as companyName,
b.delivery_type,
b.source_type,
b.move_type,
b.delivery_code,
a.entry_number
from tld_delivery a
join tld_delivery_f b on a.delivery_id = b.delivery_id
join tld_material c on a.material_id = c.tld_id
left join tld_customer g on b.customer_code = g.code
left join tld_company v on b.company_number = v.code
and a.delivery_id like CONCAT(CONCAT('%', #{deliveryId}), '%')
and b.delivery_code like CONCAT(CONCAT('%', #{deliveryCode}), '%')
and c.code like CONCAT(CONCAT('%', #{materialCode}), '%')
and c.name like CONCAT(CONCAT('%', #{materialName}), '%')
and b.bills_time =]]> #{startTime}
and b.bills_time #{endTime}
and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
and b.company_number = #{companyNumber}
and b.customer_code = #{customerCode}
and a.entry_number like CONCAT(CONCAT('%', #{entryNumber}), '%')
and b.delivery_type like CONCAT(CONCAT('%', #{deliveryType}), '%')
and b.source_type like CONCAT(CONCAT('%', #{sourceType}), '%')
and b.move_type like CONCAT(CONCAT('%', #{moveType}), '%')
order by a.id desc
select
b.delivery_code,
a.material_id,
a.wbs,
a.gs_delivery_num,
a.gs_cancel_num,
a.out_num,
v.name as companyName,
b.bills_time,
c.name as materialName,
c.code as materialCode,
g.name as customerName,
b.source_type,
b.move_type,
b.delivery_type,
a.entry_number
from tld_delivery a
join tld_delivery_f b on a.delivery_id = b.delivery_id
join tld_material c on a.material_id = c.tld_id
left join tld_customer g on b.customer_code = g.code
left join tld_company v on b.company_number = v.code
and a.delivery_id like CONCAT(CONCAT('%', #{deliveryId}), '%')
and b.delivery_code like CONCAT(CONCAT('%', #{deliveryCode}), '%')
and c.code like CONCAT(CONCAT('%', #{materialCode}), '%')
and c.name like CONCAT(CONCAT('%', #{materialName}), '%')
and b.bills_time =]]> #{startTime}
and b.bills_time #{endTime}
and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
and b.company_number = #{companyNumber}
and b.customer_code = #{customerCode}
and a.entry_number like CONCAT(CONCAT('%', #{entryNumber}), '%')
and b.delivery_type like CONCAT(CONCAT('%', #{deliveryType}), '%')
and b.source_type like CONCAT(CONCAT('%', #{sourceType}), '%')
and b.move_type like CONCAT(CONCAT('%', #{moveType}), '%')
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,
b.warehouse_transfer_code,
b.ask_goods_warehouse_id,
b.document_time,
b.warehouse_transfer_type,
c.name as materialName,
c.code as materialCode,
f.name as askGoodsWarehouseName,
e.name as supplyWarehouseName,
a.account_sleeve as accountSleeve,
k.name as companyName
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
join tld_company k on a.account_sleeve = k.code
and a.type = #{type}
and c.code like CONCAT(CONCAT('%', #{materialCode}), '%')
and c.name like CONCAT(CONCAT('%', #{materialName}), '%')
and b.warehouse_transfer_code like CONCAT(CONCAT('%',#{warehouseTransferCode}),'%')
and b.document_time =]]> #{startTime}
and b.document_time #{endTime}
and b.ask_goods_warehouse_id = #{askGoodsWarehouseId}
and a.supply_warehouse_id = #{supplyWarehouseId}
and b.warehouse_transfer_type like CONCAT(CONCAT('%', #{warehouseTransferType}), '%')
and a.account_sleeve = #{companyCode}
and a.entry_number like CONCAT(CONCAT('%', #{entryNumber}), '%')
and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
order by a.id desc
select
a.warehouse_transfer_id,
b.warehouse_transfer_code,
c.name as materialName,
c.code as materialCode,
a.wbs,
a.num,
a.out_num,
f.name as askGoodsWarehouseaName,
e.name as supplyWarehouseName,
b.document_time
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
join tld_company k on a.account_sleeve = k.code
and a.type = #{type}
and c.code like CONCAT(CONCAT('%', #{materialCode}), '%')
and c.name like CONCAT(CONCAT('%', #{materialName}), '%')
and b.warehouse_transfer_code like CONCAT(CONCAT('%',#{warehouseTransferCode}),'%')
and b.document_time =]]> #{startTime}
and b.document_time #{endTime}
and b.ask_goods_warehouse_id = #{askGoodsWarehouseId}
and a.supply_warehouse_id = #{supplyWarehouseId}
and b.warehouse_transfer_type like CONCAT(CONCAT('%', #{warehouseTransferType}), '%')
and a.account_sleeve = #{companyCode}
and a.entry_number like CONCAT(CONCAT('%', #{entryNumber}), '%')
and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
order by a.id desc
SELECT
a.id,
a.user_id,
a.scrq,
a.DATA,
a.type,
a.document_type,
b.user_name
FROM
tld_log_data a
LEFT JOIN tld_user b ON a.user_id = b.id
and a.document_type = #{documentType}
and a.data like CONCAT(CONCAT('%', #{data}), '%')
and a.scrq =]]> #{startTime}
and a.scrq #{endTime}
and b.user_name like CONCAT(CONCAT('%', #{userName}), '%')
ORDER BY a.scrq DESC
SELECT
b.code as wllbCode,
b.name as materialName,
c.storage_location_name as storageLocationName,
f.name as companyName,
e.name as ustomerName,
a.wbs as wbs,
a.amount as amount,
a.scrq as scrq
FROM tld_inventory a
JOIN tld_material b ON a.material_id = b.tld_id
LEFT JOIN tld_storage_location c ON a.storage_location_code = c.storage_location_code
LEFT JOIN tld_customer e ON a.supplier_id = e.code
LEFT JOIN tld_company f ON a.account_sleeve = f.code
WHERE datediff(now(), a.scrq) ]]> 90
and a.storage_location_code = #{storageLocationCode}
and b.name like CONCAT(CONCAT('%', #{materialName}), '%')
and b.code like CONCAT(CONCAT('%', #{wllbCode}), '%')
and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
and c.storage_location_name like CONCAT(CONCAT('%', #{storageLocationName}), '%')
and a.supplier_id = #{ustomerCode}
and a.account_sleeve = #{companyCode}
SELECT
a.NAME as materialName,
a.CODE as wllbCode,
ifnull(b.sum,0) AS amount,
ifnull(a.max_num,'0') AS maxNum,
ifnull(a.min_num,'0') AS minNum
FROM
tld_material a
LEFT JOIN ( SELECT SUM( amount ) AS sum, material_id FROM tld_inventory GROUP BY material_id ) b ON a.tld_id =
b.material_id
WHERE
(
IF(a.max_num IS NULL,FALSE,IF( b.sum IS NULL, 0, b.sum + 0 ) ]]> a.max_num)
OR
IF(a.min_num IS NULL,FALSE,IF( b.sum IS NULL, 0, b.sum + 0 ) a.min_num)
)
and a.name like CONCAT(CONCAT('%', #{materialName}), '%')
and a.code like CONCAT(CONCAT('%', #{wllbCode}), '%')
SELECT
a.CODE as wllbCode,
a.NAME as materialName,
ifnull(b.sum,0) AS amount,
ifnull(a.max_num,'0') AS maxNum,
ifnull(a.min_num,'0') AS minNum
FROM
tld_material a
LEFT JOIN ( SELECT SUM( amount ) AS sum, material_id FROM tld_inventory GROUP BY material_id ) b ON a.tld_id =
b.material_id
WHERE
(
IF(a.max_num IS NULL,FALSE,IF( b.sum IS NULL, 0, b.sum + 0 ) ]]> a.max_num)
OR
IF(a.min_num IS NULL,FALSE,IF( b.sum IS NULL, 0, b.sum + 0 ) a.min_num)
)
and a.name like CONCAT(CONCAT('%', #{materialName}), '%')
and a.code like CONCAT(CONCAT('%', #{wllbCode}), '%')
select type,data,
case access_type
when '0' then '接入'
when '1' then '接出'
end as access_type,
scrq
from tld_access
and type = #{type}
and access_type = #{accessType}
and data like CONCAT(CONCAT('%', #{data}), '%')
and scrq =]]> #{startTime}
and scrq #{endTime}
order by id desc
SELECT
b.user_name,
a.document_type,
a.DATA,
a.scrq
FROM
tld_log_data a
LEFT JOIN tld_user b ON a.user_id = b.id
and a.document_type = #{documentType}
and a.data like CONCAT(CONCAT('%', #{data}), '%')
and a.scrq =]]> #{startTime}
and a.scrq #{endTime}
and b.user_name like CONCAT(CONCAT('%', #{userName}), '%')
ORDER BY a.scrq DESC
select ifnull(sum(amount),'0') as amount from tld_inventory where wbs = #{wbs} and account_sleeve = #{companyNumber} and wllb_code = #{materialCode}
select ifnull(sum(amount),'0') as amount from tld_inventory where wbs = #{wbs} and account_sleeve = #{companyNumber} and wllb_code = #{materialCode}
select
a.id,
a.notice_id,
a.entry_number,
a.material_id,
a.wbs,
a.measurement_id,
a.num,
a.entry_number,
a.warehousing_num,
b.notice_code,
b.company_number,
b.notice_time,
b.source_type,
b.move_type,
b.notification_type_number,
b.notification_type_name,
c.name as materialName,
c.code as materialCode,
c.part_type,
k.name as companyName
from tld_notices a
join tld_notices_f b on a.notice_id = b.notice_id
join tld_material c on a.material_id = c.tld_id
join tld_company k on b.company_number = k.code
IFNULL(a.warehousing_num, 0) (a.num + 0)
IFNULL(a.warehousing_num, 0) (a.num + 0)
and c.code like CONCAT(CONCAT('%', #{materialCode}), '%')
and c.name like CONCAT(CONCAT('%', #{materialName}), '%')
and b.notice_code like CONCAT(CONCAT('%', #{noticeCode}), '%')
and c.tld_id like CONCAT(CONCAT('%', #{materialId}), '%')
and c.part_type = #{partType}
and b.notice_time =]]> #{startTime}
and b.notice_time #{endTime}
and b.company_number = #{companyNumber}
and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
order by a.id desc
update tld_storage set transmission_type = #{type} where storage_code = #{wmsCode}
and wllb_code = #{code}
;
update tld_removal set transmission_type = #{type} where storage_code = #{wmsCode}
and wllb_code = #{code}
;
update tld_removal_half_product set transmission_type = #{type} where storage_code = #{wmsCode}
and wllb_code = #{code}
;
update tld_removal_half set transmission_type = #{type} where storage_code = #{wmsCode}
and wllb_code = #{code}
;
update tld_half set transmission_type = #{type} where storage_code = #{wmsCode}
and wllb_code = #{code}
;
update tld_half_product set transmission_type = #{type} where storage_code = #{wmsCode}
and wllb_code = #{code}
;
select
a.id,
a.ask_goods_id,
a.material_id,
a.wbs,
a.measurement_id,
a.num,
a.out_num,
a.entry_number,
b.ask_goods_code,
b.company_number,
b.sqrq,
p.name as department,
b.source_type,
b.move_type,
b.request_type_number,
b.request_type_name,
b.if_commodity,
b.id as documentPointsId,
c.name as materialName,
c.code as materialCode,
c.part_type,
k.name as companyName
from tld_enquiry a
join tld_enquiry_f b on a.ask_goods_id = b.ask_goods_id
join tld_material c on a.material_id = c.tld_id
join tld_company k on b.company_number = k.code
join tld_department p on b.department = p.code
IFNULL(a.out_num, 0) (a.num + 0)
IFNULL(a.out_num, 0) (a.num + 0)
and c.code like CONCAT(CONCAT('%', #{materialCode}), '%')
and c.name like CONCAT(CONCAT('%', #{materialName}), '%')
and b.ask_goods_code like CONCAT(CONCAT('%', #{askGoodsCode}), '%')
and b.department = #{departmentCode}
and c.tld_id like CONCAT(CONCAT('%', #{materialId}), '%')
and c.part_type = #{partType}
and b.sqrq =]]> #{startTime}
and b.sqrq #{endTime}
and b.company_number = #{companyNumber}
and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
order by a.id desc
select
a.id,
a.supplier_id,
a.order_code,
a.material_id,
a.purchase_num,
a.arrival_num,
a.arrival_time,
a.type,
b.name as materialName,
b.code as wllbCode,
b.wllb_class as wllbClass,
c.name as supplierName
from tld_purchase a
left join tld_material b on a.material_id = b.tld_id
left join tld_customer c on a.supplier_id = c.code
where DATE(a.arrival_time) DATE(NOW())
and a.type = '0'
select sum(arrival_num) from tld_purchase where DATE(arrival_time) DATE(NOW())
select sum(arrival_num) from tld_purchase where DATE(arrival_time) DATE(NOW()) and type = '1'
select sum(arrival_num) from tld_purchase where DATE(arrival_time) DATE(NOW()) and type = '0'
select sum(arrival_num) from tld_purchase
where DATE(arrival_time) DATE(NOW())
and arrival_time NOW()
and type = '0'
select IFNULL(sum(warehousing_num),0) as amount from tld_receive_goods a
left join tld_receive_goods_f b on a.order_code = b.order_code
left join tld_material c on a.material_id = c.tld_id
where c.part_type = #{nameType}
and DATE_FORMAT( b.arrival_time, '%Y-%m-%d' ) = #{format}
select IFNULL(sum(warehousing_num),0) as amount from tld_notices a
left join tld_notices_f b on a.notice_id = b.notice_id
left join tld_material c on a.material_id = c.tld_id
where c.part_type = #{nameType}
and DATE_FORMAT( b.notice_time, '%Y-%m-%d' ) = #{format}
select IFNULL(sum(out_num),0) as amount from tld_ask_goods a
left join tld_ask_goods_f b on a.ask_goods_id = b.ask_goods_id
left join tld_material c on a.material_id = c.tld_id
where c.part_type = #{nameType}
and DATE_FORMAT( b.sqrq, '%Y-%m-%d' ) = #{format}
select IFNULL(sum(out_num),0) as amount from tld_invite a
left join tld_invite_f b on a.ask_goods_id = b.ask_goods_id
left join tld_material c on a.material_id = c.tld_id
where c.part_type = #{nameType}
and DATE_FORMAT( b.sqrq, '%Y-%m-%d' ) = #{format}
select IFNULL(sum(out_num),0) as amount from tld_enquiry a
left join tld_enquiry_f b on a.ask_goods_id = b.ask_goods_id
left join tld_material c on a.material_id = c.tld_id
where c.part_type = #{nameType}
and DATE_FORMAT( b.sqrq, '%Y-%m-%d' ) = #{format}
select IFNULL(sum(warehousing_num),0) as amount from tld_notice a
left join tld_notice_f b on a.notice_id = b.notice_id
left join tld_material c on a.material_id = c.tld_id
where c.part_type = #{nameType}
and DATE_FORMAT( b.notice_time, '%Y-%m-%d' ) = #{format}
select IFNULL(sum(out_num),0) as amount from tld_delivery a
left join tld_delivery_f b on a.delivery_id = b.delivery_id
left join tld_material c on a.material_id = c.tld_id
where c.part_type = #{nameType}
and DATE_FORMAT( b.bills_time, '%Y-%m-%d' ) = #{format}
SELECT
a.id,
a.scrq,
a.modify_time AS modifyTime,
b.code,
b.name,
b.part_type AS partType,
c.user_name AS userName,
c.real_name AS realName,
d.user_name AS modifyUserName,
d.real_name AS modifyRealName,
d.modify_time AS modifyTime
FROM tld_user_material a
LEFT JOIN tld_material b ON a.material_id = b.CODE
LEFT JOIN tld_user c ON a.user_id = c.id
LEFT JOIN tld_user d ON a.modify_user = d.id
and a.user_id = #{userId}
ORDER BY a.id DESC
SELECT
a.id,
YEAR(CURDATE()) AS year,
MONTH(CURDATE()) AS month,
f.code as warehouseCode,
f.name as warehouseName,
b.storage_location_name as storageLocationName,
c.code as code,
c.name as name,
m.name as unitOfMeasurement,
a.amount AS sum,
a.wbs as wbs,
c.max_num as maxNum,
DATEDIFF(now(), scrq) as day,
c.part_type as partType,
c.wllb_class as wllbClass,
p.code as companyCode,
p.name as companyName,
a.account_sleeve as accountSleeve,
a.supplier_id as supplierId,
e.name as supplierName,
a.storage_location_code as storageLocationCode
FROM
tld_inventory a
LEFT JOIN tld_storage_location b ON a.storage_location_code = b.storage_location_code
LEFT JOIN tld_material c ON a.material_id = c.tld_id
LEFT JOIN tld_customer e ON a.supplier_id = e.code
LEFT JOIN tld_warehouse f on b.warehouse_where = f.tld_id
LEFT JOIN tld_company p on a.account_sleeve = p.code
LEFT JOIN tld_measurement m on c.unit_of_measurement = m.tld_id
and a.storage_location_code = #{storageLocationCode}
and a.material_id = #{materialId}
and c.code like CONCAT(CONCAT('%', #{wllbCode}), '%')
and c.name like CONCAT(CONCAT('%', #{materialName}), '%')
and b.storage_location_name like CONCAT(CONCAT('%', #{storageLocationName}), '%')
and p.name like CONCAT(CONCAT('%', #{companyName}), '%')
and p.code = #{companyCode}
and a.supplier_id like CONCAT(CONCAT('%', #{supplierId}), '%')
and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
and f.tld_id = #{warehouseId}
and c.part_type = #{partType}
and c.wllb_class = #{wllbClass}
and c.unit_of_measurement = #{unitOfMeasurement}
and (a.amount + 0) ]]> (#{amount} + 0)
select DISTINCT ask_goods_id from tld_ask_goods_vitrual where unique_code = "1111"