|
@@ -152,6 +152,7 @@
|
|
|
<!-- 查询库位信息 -->
|
|
|
<select id="getQueryInventory" resultType="java.util.Map">
|
|
|
SELECT
|
|
|
+ a.id,
|
|
|
a.storage_location_code as storageLocationCode,
|
|
|
a.material_id as materialId,
|
|
|
a.amount AS sum,
|
|
@@ -181,6 +182,15 @@
|
|
|
<if test="materialId != null and materialId != ''">
|
|
|
and a.material_id = #{materialId}
|
|
|
</if>
|
|
|
+ <if test="wbs != null and wbs != ''">
|
|
|
+ and a.wbs = #{wbs}
|
|
|
+ </if>
|
|
|
+ <if test="companyCode != null and companyCode != ''">
|
|
|
+ and a.account_sleeve = #{companyCode}
|
|
|
+ </if>
|
|
|
+ <if test="amount != null and amount != ''">
|
|
|
+ and (a.amount + 0) <![CDATA[>]]> #{amount}
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</select>
|
|
|
<!--导出-->
|
|
@@ -1251,4 +1261,83 @@
|
|
|
</trim>
|
|
|
ORDER BY a.id DESC
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="storageLocationNum" resultType="java.util.Map">
|
|
|
+ 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
|
|
|
+ <trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
+ <if test="storageLocationCode != null and storageLocationCode != ''">
|
|
|
+ and a.storage_location_code = #{storageLocationCode}
|
|
|
+ </if>
|
|
|
+ <if test="materialId != null and materialId != ''">
|
|
|
+ and a.material_id = #{materialId}
|
|
|
+ </if>
|
|
|
+ <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 p.code = #{companyCode}
|
|
|
+ </if>
|
|
|
+ <if test="supplierId != null and supplierId != ''">
|
|
|
+ and a.supplier_id like CONCAT(CONCAT('%', #{supplierId}), '%')
|
|
|
+ </if>
|
|
|
+ <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>
|
|
|
+ and (a.amount + 0) <![CDATA[>]]> (#{amount} + 0)
|
|
|
+ </trim>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getTestTwo" resultType="java.util.Map">
|
|
|
+ select DISTINCT ask_goods_id from tld_ask_goods_vitrual
|
|
|
+ </select>
|
|
|
</mapper>
|