|
@@ -641,11 +641,11 @@
|
|
|
ROUND( SUM(TW.f_grossweight) / 1000, 2 ) as normalCnt,
|
|
|
'' AS receiptCnt
|
|
|
FROM
|
|
|
- t_warehousebills TW
|
|
|
+ t_warehousebillsitems TW
|
|
|
LEFT JOIN t_goods TG ON TG.f_id = TW.f_goodsid
|
|
|
<where>
|
|
|
TW.del_flag = '0'
|
|
|
- AND TW.f_warehouseid = #{wareHouseId}
|
|
|
+ AND TW.f_warehouselocid = #{wareHouseId}
|
|
|
<if test="countType != null and countType != '' and countType == 2">
|
|
|
and TW.f_billtype in ('SJRK','SJCK')
|
|
|
</if>
|
|
@@ -737,46 +737,40 @@
|
|
|
|
|
|
<select id="inventoryQueries" resultType="com.ruoyi.warehouseBusiness.response.InventoryQueryResponse">
|
|
|
SELECT
|
|
|
- TWBI.f_business_type,
|
|
|
- TW.f_mblno AS warehouseSerialNumber,
|
|
|
+ TWH.f_no AS warehouseSerialNumber,
|
|
|
+ TW.f_mblno AS blNo,
|
|
|
TW.f_originalbilldate AS originalWarehousingDate,
|
|
|
- TG.f_name AS cargoName,
|
|
|
- TW.f_marks AS cargoModel,
|
|
|
- (
|
|
|
- CASE
|
|
|
- TWBI.f_business_type
|
|
|
- WHEN '2' THEN
|
|
|
- TWBI.f_marks
|
|
|
- ELSE '' END
|
|
|
- ) AS cargoSpec,
|
|
|
- SUM( TW.f_qtyblc ) AS cargoQuantity,
|
|
|
- IFNULL( ROUND( SUM( TW.f_netweightblc ) / 1000, 2 ), 0 ) AS netWeight,
|
|
|
- IFNULL( ROUND( SUM( TW.f_grossweightblc ) / 1000, 2 ), 0 ) AS grossWeight,
|
|
|
- TWH.f_addr AS warehouseAddress,
|
|
|
+ TW.f_originalbilldate AS rentBeginDate,
|
|
|
TC.f_name AS sourceOwnerName,
|
|
|
TC.uscc AS sourceOwnerSocialIdentifier,
|
|
|
TC.f_name AS currentOwnerName,
|
|
|
TC.uscc AS currentOwnerSocialIdentifier,
|
|
|
- TW.f_originalbilldate AS rentBeginDate,
|
|
|
- '' AS storageRate,
|
|
|
- TW.f_marks AS mark,
|
|
|
- SUM( TW.f_qtyblc ) AS number,
|
|
|
- (CASE
|
|
|
- TWBI.f_business_type
|
|
|
- WHEN '3' THEN
|
|
|
- TWBI.f_marks ELSE ''
|
|
|
- END) AS manufacturer,
|
|
|
- '' AS trademark,
|
|
|
- '' AS grade,
|
|
|
- TG.f_packagespecs AS packing,
|
|
|
- '' AS country,
|
|
|
- '' AS process,
|
|
|
- TWBI.f_warehouse_information AS location
|
|
|
+ TWH.f_addr AS warehouseAddress,
|
|
|
+ TG.f_name AS cargoName,
|
|
|
+ TW.f_marks AS cargoModel,
|
|
|
+ TW.f_marks AS cargoSpec,
|
|
|
+ IFNULL( ROUND( SUM( TW.f_netweightblc ) / 1000, 2 ), 0 ) AS netWeight,
|
|
|
+ IFNULL( ROUND( SUM( TW.f_grossweightblc ) / 1000, 2 ), 0 ) AS grossWeight,
|
|
|
+ SUM( TW.f_qtyblc ) AS cargoQuantity
|
|
|
+-- '' AS storageRate,
|
|
|
+-- TW.f_marks AS mark,
|
|
|
+-- SUM( TW.f_qtyblc ) AS number,
|
|
|
+-- (CASE
|
|
|
+-- TWBI.f_business_type
|
|
|
+-- WHEN '3' THEN
|
|
|
+-- TWBI.f_marks ELSE ''
|
|
|
+-- END) AS manufacturer,
|
|
|
+-- '' AS trademark,
|
|
|
+-- '' AS grade,
|
|
|
+-- TG.f_packagespecs AS packing,
|
|
|
+-- '' AS country,
|
|
|
+-- '' AS process,
|
|
|
+-- TWBI.f_warehouse_information AS location
|
|
|
FROM t_whgenleg TW
|
|
|
LEFT JOIN t_goods TG ON TG.f_id = TW.f_goodsid
|
|
|
LEFT JOIN t_warehouse TWH ON TW.f_warehouseid = TWH.f_id
|
|
|
LEFT JOIN t_corps TC ON TC.f_id = TW.f_corpid
|
|
|
- LEFT JOIN (
|
|
|
+ <!--LEFT JOIN (
|
|
|
SELECT DISTINCT
|
|
|
TWB.f_ifpledge,
|
|
|
TWB.f_mblno,
|
|
@@ -796,11 +790,11 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
) TWBI ON TWBI.f_mblno = TW.f_mblno
|
|
|
- AND TWBI.f_warehouselocid = TW.f_warehouseid
|
|
|
+ AND TWBI.f_warehouselocid = TW.f_warehouseid-->
|
|
|
<where>
|
|
|
TW.del_flag = '0'
|
|
|
and TW.f_netweightblc != 0
|
|
|
- AND (TWBI.f_ifpledge != 0 or TWBI.f_ifpledge IS NULL)
|
|
|
+ /* AND (TWBI.f_ifpledge != 0 or TWBI.f_ifpledge IS NULL)*/
|
|
|
<if test="ownerName != null and ownerName != ''">
|
|
|
and TC.f_name = #{ownerName}
|
|
|
</if>
|
|
@@ -808,7 +802,7 @@
|
|
|
and TC.uscc = #{identifier}
|
|
|
</if>
|
|
|
<if test="numbersList != null and numbersList != ''">
|
|
|
- and TW.f_mblno in
|
|
|
+ and TWH.f_no in
|
|
|
<foreach item="number" collection="numbersList" open="(" separator="," close=")">
|
|
|
#{number}
|
|
|
</foreach>
|
|
@@ -860,4 +854,20 @@
|
|
|
parent_id = #{fWarehouseid} and del_flag = '0' and f_name =#{stringCellValue}
|
|
|
</where>
|
|
|
</select>
|
|
|
+ <select id="getStorageTopS" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ TG.f_name AS goodsName,
|
|
|
+ ROUND( SUM(TW.f_grossweightblc) / 1000, 2 ) as normalCnt,
|
|
|
+ '' AS receiptCnt
|
|
|
+ FROM
|
|
|
+ t_whgenleg TW
|
|
|
+ LEFT JOIN t_goods TG ON TG.f_id = TW.f_goodsid
|
|
|
+ <where>
|
|
|
+ TW.del_flag = '0'
|
|
|
+ AND TW.f_warehouseid = #{wareHouseId}
|
|
|
+ </where>
|
|
|
+ GROUP BY TW.f_goodsid
|
|
|
+ ORDER BY IFNULL( ROUND( SUM(TW.f_grossweightblc) / 1000, 2 ), 0 ) DESC
|
|
|
+ LIMIT #{topCnt}
|
|
|
+ </select>
|
|
|
</mapper>
|