|
@@ -19,6 +19,7 @@
|
|
|
c.storage_location_name as storageLocationName,
|
|
|
b.code as wllbCode,
|
|
|
a.wbs as wbs,
|
|
|
+ h.name as wbsName,
|
|
|
e.name as ustomerName,
|
|
|
a.account_sleeve as accountSleeve,
|
|
|
f.name as companyName
|
|
@@ -27,6 +28,7 @@
|
|
|
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
|
|
|
+ left join tld_wbs h on a.wbs = h.tld_id
|
|
|
WHERE datediff(now(), a.scrq) <![CDATA[>]]> 90
|
|
|
<if test="storageLocationCode != null and storageLocationCode != ''">
|
|
|
and a.storage_location_code = #{storageLocationCode}
|
|
@@ -38,7 +40,7 @@
|
|
|
and b.code like CONCAT(CONCAT('%', #{wllbCode}), '%')
|
|
|
</if>
|
|
|
<if test="wbs != null and wbs != ''">
|
|
|
- and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
+ and h.name like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
</if>
|
|
|
<if test="storageLocationName != null and storageLocationName != ''">
|
|
|
and c.storage_location_name like CONCAT(CONCAT('%', #{storageLocationName}), '%')
|
|
@@ -92,6 +94,7 @@
|
|
|
m.name as unitOfMeasurement,
|
|
|
sum( a.amount ) AS sum,
|
|
|
a.wbs as wbs,
|
|
|
+ h.name as wbsName,
|
|
|
c.max_num as maxNum,
|
|
|
DATEDIFF(now(), scrq) as day,
|
|
|
c.part_type as partType,
|
|
@@ -110,6 +113,7 @@
|
|
|
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
|
|
|
+ left join tld_wbs h on a.wbs = h.tld_id
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="storageLocationCode != null and storageLocationCode != ''">
|
|
|
and a.storage_location_code = #{storageLocationCode}
|
|
@@ -136,7 +140,7 @@
|
|
|
and a.supplier_id like CONCAT(CONCAT('%', #{supplierId}), '%')
|
|
|
</if>
|
|
|
<if test="wbs != null and wbs != ''">
|
|
|
- and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
+ and h.name like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
</if>
|
|
|
<if test="warehouseId != null and warehouseId != ''">
|
|
|
and f.tld_id = #{warehouseId}
|
|
@@ -210,7 +214,8 @@
|
|
|
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,
|
|
|
+ if(a.wbs = " ", null, a.wbs) as wbs,
|
|
|
+ if(h.name = " ", null, h.name) as wbsName,
|
|
|
ifnull(c.max_num, 0) as max_num,
|
|
|
DATEDIFF(now(),scrq) as day,
|
|
|
ifnull(c.part_type, "暂无分类") as part_type,
|
|
@@ -223,6 +228,7 @@
|
|
|
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_wbs h on a.wbs = h.tld_id
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="storageLocationCode != null and storageLocationCode != ''">
|
|
|
and a.storage_location_code = #{storageLocationCode}
|
|
@@ -246,7 +252,7 @@
|
|
|
and a.supplier_id like CONCAT(CONCAT('%', #{supplierId}), '%')
|
|
|
</if>
|
|
|
<if test="wbs != null and wbs != ''">
|
|
|
- and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
+ and h.name like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
</if>
|
|
|
<if test="warehouseId != null and warehouseId != ''">
|
|
|
and f.tld_id = #{warehouseId}
|
|
@@ -300,13 +306,15 @@
|
|
|
b.move_type,
|
|
|
a.entry_number,
|
|
|
a.production_code,
|
|
|
- a.wbs
|
|
|
+ a.wbs,
|
|
|
+ w.name as wbsName
|
|
|
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
|
|
|
+ left join tld_wbs w on a.wbs = w.tld_id
|
|
|
/* WHERE e.part_type != '半成品' and e.part_type != '产成品'*/
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="materialCode != null and materialCode != ''">
|
|
@@ -337,7 +345,7 @@
|
|
|
and a.entry_number like CONCAT(CONCAT('%', #{entryNumber}), '%')
|
|
|
</if>
|
|
|
<if test="wbs != null and wbs != ''">
|
|
|
- and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
+ and w.name like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
</if>
|
|
|
<if test="askGoodsCode != null and askGoodsCode != ''">
|
|
|
and b.ask_goods_code like CONCAT(CONCAT('%', #{askGoodsCode}), '%')
|
|
@@ -357,7 +365,8 @@
|
|
|
e.NAME AS materialName,
|
|
|
e.CODE AS materialCode,
|
|
|
b.ask_goods_code,
|
|
|
- a.wbs,
|
|
|
+ if(a.wbs = '' , null , a.wbs ) as wbs,
|
|
|
+ if(w.name = '' , null , w.name ) as wbsName,
|
|
|
b.company_number,
|
|
|
g.name as companyName
|
|
|
FROM
|
|
@@ -366,6 +375,7 @@
|
|
|
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
|
|
|
+ left join tld_wbs w on a.wbs = w.tld_id
|
|
|
/*WHERE e.part_type != '半成品' and e.part_type != '产成品'*/
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="materialCode != null and materialCode != ''">
|
|
@@ -396,7 +406,7 @@
|
|
|
and a.entry_number like CONCAT(CONCAT('%', #{entryNumber}), '%')
|
|
|
</if>
|
|
|
<if test="wbs != null and wbs != ''">
|
|
|
- and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
+ and w.name like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
</if>
|
|
|
<if test="askGoodsCode != null and askGoodsCode != ''">
|
|
|
and b.ask_goods_code like CONCAT(CONCAT('%', #{askGoodsCode}), '%')
|
|
@@ -426,13 +436,15 @@
|
|
|
b.move_type ,
|
|
|
a.entry_number,
|
|
|
a.production_code,
|
|
|
- a.wbs
|
|
|
+ a.wbs,
|
|
|
+ w.name as wbsName
|
|
|
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
|
|
|
+ left join tld_wbs w on a.wbs = w.tld_id
|
|
|
/*WHERE*/
|
|
|
/*e.part_type != '半成品' and e.part_type != '产成品'*/
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
@@ -464,7 +476,7 @@
|
|
|
and a.entry_number like CONCAT(CONCAT('%', #{entryNumber}), '%')
|
|
|
</if>
|
|
|
<if test="wbs != null and wbs != ''">
|
|
|
- and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
+ and w.name like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
</if>
|
|
|
<if test="askGoodsCode != null and askGoodsCode != ''">
|
|
|
and b.ask_goods_code like CONCAT(CONCAT('%', #{askGoodsCode}), '%')
|
|
@@ -485,7 +497,8 @@
|
|
|
e.NAME AS materialName,
|
|
|
e.CODE AS materialCode,
|
|
|
b.ask_goods_code,
|
|
|
- a.wbs,
|
|
|
+ if(a.wbs = '' , null , a.wbs ) as wbs,
|
|
|
+ if(w.name = '' , null , w.name ) as wbsName,
|
|
|
b.company_number,
|
|
|
g.name as companyName
|
|
|
FROM
|
|
@@ -494,6 +507,7 @@
|
|
|
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
|
|
|
+ left join tld_wbs w on a.wbs = w.tld_id
|
|
|
/*WHERE e.part_type != '半成品' and e.part_type != '产成品'*/
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="materialCode != null and materialCode != ''">
|
|
@@ -524,7 +538,7 @@
|
|
|
and a.entry_number like CONCAT(CONCAT('%', #{entryNumber}), '%')
|
|
|
</if>
|
|
|
<if test="wbs != null and wbs != ''">
|
|
|
- and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
+ and w.name like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
</if>
|
|
|
<if test="askGoodsCode != null and askGoodsCode != ''">
|
|
|
and b.ask_goods_code like CONCAT(CONCAT('%', #{askGoodsCode}), '%')
|
|
@@ -542,6 +556,7 @@
|
|
|
a.delivery_id,
|
|
|
a.material_id,
|
|
|
a.wbs,
|
|
|
+ w.name as wbsName,
|
|
|
a.gs_delivery_num,
|
|
|
a.gs_cancel_num,
|
|
|
ifnull(a.out_num, 0) as out_num,
|
|
@@ -562,6 +577,7 @@
|
|
|
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
|
|
|
+ left join tld_wbs w on a.wbs = w.tld_id
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="deliveryId != null and deliveryId != ''">
|
|
|
and a.delivery_id like CONCAT(CONCAT('%', #{deliveryId}), '%')
|
|
@@ -582,7 +598,7 @@
|
|
|
and b.bills_time <![CDATA[<=]]> #{endTime}
|
|
|
</if>
|
|
|
<if test="wbs != null and wbs != ''">
|
|
|
- and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
+ and w.name like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
</if>
|
|
|
<if test="companyNumber != null and companyNumber != ''">
|
|
|
and b.company_number = #{companyNumber}
|
|
@@ -617,6 +633,7 @@
|
|
|
b.delivery_code,
|
|
|
a.material_id,
|
|
|
if(a.wbs = '', null, a.wbs) as wbs,
|
|
|
+ if(w.name = '' , null , w.name ) as wbsName,
|
|
|
a.gs_delivery_num,
|
|
|
a.gs_cancel_num,
|
|
|
a.out_num,
|
|
@@ -634,6 +651,7 @@
|
|
|
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
|
|
|
+ left join tld_wbs w on a.wbs = w.tld_id
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="deliveryId != null and deliveryId != ''">
|
|
|
and a.delivery_id like CONCAT(CONCAT('%', #{deliveryId}), '%')
|
|
@@ -654,7 +672,7 @@
|
|
|
and b.bills_time <![CDATA[<=]]> #{endTime}
|
|
|
</if>
|
|
|
<if test="wbs != null and wbs != ''">
|
|
|
- and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
+ and w.name like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
</if>
|
|
|
<if test="companyNumber != null and companyNumber != ''">
|
|
|
and b.company_number = #{companyNumber}
|
|
@@ -685,6 +703,7 @@
|
|
|
a.supply_warehouse_id,
|
|
|
a.material_id,
|
|
|
a.wbs,
|
|
|
+ h.name as wbsName,
|
|
|
a.num,
|
|
|
a.out_num,
|
|
|
a.type,
|
|
@@ -704,6 +723,7 @@
|
|
|
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
|
|
|
+ left join tld_wbs h on a.wbs = h.tld_id
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="type != null and type != ''">
|
|
|
and a.type = #{type}
|
|
@@ -739,7 +759,7 @@
|
|
|
and a.entry_number like CONCAT(CONCAT('%', #{entryNumber}), '%')
|
|
|
</if>
|
|
|
<if test="wbs != null and wbs != ''">
|
|
|
- and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
+ and h.name like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
</if>
|
|
|
</trim>
|
|
|
order by a.id desc
|
|
@@ -751,7 +771,8 @@
|
|
|
b.warehouse_transfer_code,
|
|
|
c.name as materialName,
|
|
|
c.code as materialCode,
|
|
|
- a.wbs,
|
|
|
+ if(a.wbs = '', null, a.wbs) as wbs,
|
|
|
+ if( h.name = '', null, h.name) as wbsName,
|
|
|
a.num,
|
|
|
a.out_num,
|
|
|
f.name as askGoodsWarehouseaName,
|
|
@@ -763,6 +784,7 @@
|
|
|
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
|
|
|
+ left join tld_wbs h on a.wbs = h.tld_id
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="type != null and type != ''">
|
|
|
and a.type = #{type}
|
|
@@ -798,7 +820,7 @@
|
|
|
and a.entry_number like CONCAT(CONCAT('%', #{entryNumber}), '%')
|
|
|
</if>
|
|
|
<if test="wbs != null and wbs != ''">
|
|
|
- and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
+ and h.name like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
</if>
|
|
|
</trim>
|
|
|
order by a.id desc
|
|
@@ -843,7 +865,8 @@
|
|
|
c.storage_location_name as storageLocationName,
|
|
|
f.name as companyName,
|
|
|
e.name as ustomerName,
|
|
|
- a.wbs as wbs,
|
|
|
+ if(a.wbs = '', null,a.wbs) as wbs,
|
|
|
+ if(h.name = '', null, h.name) as wbsName,
|
|
|
a.amount as amount,
|
|
|
a.scrq as scrq
|
|
|
FROM tld_inventory a
|
|
@@ -851,6 +874,7 @@
|
|
|
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
|
|
|
+ left join tld_wbs h on a.wbs = h.tld_id
|
|
|
WHERE datediff(now(), a.scrq) <![CDATA[>]]> 90
|
|
|
<if test="storageLocationCode != null and storageLocationCode != ''">
|
|
|
and a.storage_location_code = #{storageLocationCode}
|
|
@@ -862,7 +886,7 @@
|
|
|
and b.code like CONCAT(CONCAT('%', #{wllbCode}), '%')
|
|
|
</if>
|
|
|
<if test="wbs != null and wbs != ''">
|
|
|
- and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
+ and h.name like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
</if>
|
|
|
<if test="storageLocationName != null and storageLocationName != ''">
|
|
|
and c.storage_location_name like CONCAT(CONCAT('%', #{storageLocationName}), '%')
|
|
@@ -997,6 +1021,7 @@
|
|
|
a.entry_number,
|
|
|
a.material_id,
|
|
|
a.wbs,
|
|
|
+ g.name as wbsName,
|
|
|
a.measurement_id,
|
|
|
a.num,
|
|
|
a.entry_number,
|
|
@@ -1050,7 +1075,7 @@
|
|
|
and b.company_number = #{companyNumber}
|
|
|
</if>
|
|
|
<if test="wbs != null and wbs != ''">
|
|
|
- and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
+ and g.name like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
</if>
|
|
|
</trim>
|
|
|
order by a.id desc
|
|
@@ -1089,6 +1114,7 @@
|
|
|
a.ask_goods_id,
|
|
|
a.material_id,
|
|
|
a.wbs,
|
|
|
+ g.name as wbsName,
|
|
|
a.measurement_id,
|
|
|
a.num,
|
|
|
a.out_num,
|
|
@@ -1149,7 +1175,7 @@
|
|
|
and b.company_number = #{companyNumber}
|
|
|
</if>
|
|
|
<if test="wbs != null and wbs != ''">
|
|
|
- and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
+ and g.name like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
</if>
|
|
|
</trim>
|
|
|
order by a.id desc
|