|
|
@@ -180,10 +180,15 @@
|
|
|
e.name as supplierName,
|
|
|
a.wbs,
|
|
|
a.account_sleeve
|
|
|
- FROM tld_inventory a
|
|
|
+ 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
|
|
|
+ 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}
|
|
|
@@ -191,14 +196,38 @@
|
|
|
<if test="materialId != null and materialId != ''">
|
|
|
and a.material_id = #{materialId}
|
|
|
</if>
|
|
|
- <if test="wbs != null and wbs != ''">
|
|
|
- and a.wbs = #{wbs}
|
|
|
+ <if test="wllbCode != null and wllbCode != ''">
|
|
|
+ and c.code like CONCAT(CONCAT('%', #{wllbCode}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="materialName != null and materialName != ''">
|
|
|
+ and c.name like CONCAT(CONCAT('%', #{materialName}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="storageLocationName != null and storageLocationName != ''">
|
|
|
+ and b.storage_location_name like CONCAT(CONCAT('%', #{storageLocationName}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="companyName != null and companyName != ''">
|
|
|
+ and p.name like CONCAT(CONCAT('%', #{companyName}), '%')
|
|
|
</if>
|
|
|
<if test="companyCode != null and companyCode != ''">
|
|
|
- and a.account_sleeve = #{companyCode}
|
|
|
+ and p.code = #{companyCode}
|
|
|
+ </if>
|
|
|
+ <if test="supplierId != null and supplierId != ''">
|
|
|
+ and a.supplier_id like CONCAT(CONCAT('%', #{supplierId}), '%')
|
|
|
</if>
|
|
|
- <if test="amount != null and amount != ''">
|
|
|
- and (a.amount + 0) <![CDATA[>]]> #{amount}
|
|
|
+ <if test="wbs != null and wbs != ''">
|
|
|
+ and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="warehouseId != null and warehouseId != ''">
|
|
|
+ and f.tld_id = #{warehouseId}
|
|
|
+ </if>
|
|
|
+ <if test="partType != null and partType != ''">
|
|
|
+ and c.part_type = #{partType}
|
|
|
+ </if>
|
|
|
+ <if test="wllbClass != null and wllbClass != ''">
|
|
|
+ and c.wllb_class = #{wllbClass}
|
|
|
+ </if>
|
|
|
+ <if test="unitOfMeasurement != null and unitOfMeasurement != ''">
|
|
|
+ and c.unit_of_measurement = #{unitOfMeasurement}
|
|
|
</if>
|
|
|
</trim>
|
|
|
</select>
|