|
|
@ -21,18 +21,18 @@ |
|
|
|
<select id="selInItCountBySettleTime" resultType="java.lang.String"> |
|
|
|
SELECT IFNULL(SUM(d.currentBalance), 0) AS count |
|
|
|
FROM wms_inventory_settlebill_detail AS d |
|
|
|
LEFT JOIN wms_inventory_settlebill AS s |
|
|
|
ON d.billSid = s.sid |
|
|
|
LEFT JOIN wms_inventory_settlebill AS s |
|
|
|
ON d.billSid = s.sid |
|
|
|
WHERE s.settleState = 2 |
|
|
|
AND s.createTime <= #{settleTime} |
|
|
|
GROUP BY d.billSid |
|
|
|
ORDER BY s.createTime DESC |
|
|
|
LIMIT 1 |
|
|
|
LIMIT 1 |
|
|
|
</select> |
|
|
|
<select id="selInboundAndOutboundCount" |
|
|
|
resultType="com.yxt.wms.biz.inventory.wmsinventoryrecord.report.WmsInAndOutboundVo"> |
|
|
|
SELECT IFNULL(SUM(r.count), 0) as `count`, |
|
|
|
r.billType |
|
|
|
r.billType |
|
|
|
FROM wms_inventory_record AS r |
|
|
|
<where> |
|
|
|
${ew.sqlSegment} |
|
|
@ -41,7 +41,7 @@ |
|
|
|
<select id="inventoryInboundAndOutboundStats" |
|
|
|
resultType="com.yxt.wms.biz.inventory.wmsinventoryrecord.report.WmsInventoryCountDetailsVo"> |
|
|
|
SELECT IFNULL(SUM(r.count), 0) AS `count`, |
|
|
|
r.busTypeValue |
|
|
|
r.busTypeValue |
|
|
|
FROM wms_inventory_record AS r |
|
|
|
<where> |
|
|
|
${ew.sqlSegment} |
|
|
@ -50,24 +50,24 @@ |
|
|
|
<select id="inventoryDetailsRecord" |
|
|
|
resultType="com.yxt.wms.biz.inventory.wmsinventoryrecord.report.WmsInventoryDetailsRecordVo"> |
|
|
|
SELECT CASE |
|
|
|
r.billType |
|
|
|
WHEN '1' THEN |
|
|
|
IFNULL((r.currentCount - r.count), 0) |
|
|
|
WHEN '0' THEN |
|
|
|
IFNULL((r.currentCount + r.count), 0) |
|
|
|
END initCount, |
|
|
|
r.currentCount, |
|
|
|
r.count, |
|
|
|
r.busTypeValue, |
|
|
|
r.goodsSpuName, |
|
|
|
r.createTime, |
|
|
|
r.goodsSpuName, |
|
|
|
r.goodsSkuTitle, |
|
|
|
r.goodsSkuCode, |
|
|
|
r.goodsSkuOwnSpec, |
|
|
|
r.unit, |
|
|
|
r.warehouseName, |
|
|
|
r.warehouseRackCode |
|
|
|
r.billType |
|
|
|
WHEN '1' THEN |
|
|
|
IFNULL((r.currentCount - r.count), 0) |
|
|
|
WHEN '0' THEN |
|
|
|
IFNULL((r.currentCount + r.count), 0) |
|
|
|
END initCount, |
|
|
|
r.currentCount, |
|
|
|
r.count, |
|
|
|
r.busTypeValue, |
|
|
|
r.goodsSpuName, |
|
|
|
r.createTime, |
|
|
|
r.goodsSpuName, |
|
|
|
r.goodsSkuTitle, |
|
|
|
r.goodsSkuCode, |
|
|
|
r.goodsSkuOwnSpec, |
|
|
|
r.unit, |
|
|
|
r.warehouseName, |
|
|
|
r.warehouseRackCode |
|
|
|
FROM wms_inventory_record AS r |
|
|
|
<where> |
|
|
|
${ew.sqlSegment} |
|
|
@ -96,6 +96,8 @@ |
|
|
|
wir.goodsSkuOwnSpec, |
|
|
|
wir.warehouseName, |
|
|
|
wir.warehouseRackCode, |
|
|
|
wa.areaName wareAreaName, |
|
|
|
wz.zoneName wareZoneName, |
|
|
|
wir.billNo, |
|
|
|
wir.billType, |
|
|
|
DATE_FORMAT(wir.createTime, '%Y-%m-%d') as createTime, |
|
|
@ -114,7 +116,10 @@ |
|
|
|
ui.`name` createByName |
|
|
|
from wms_inventory_record wir |
|
|
|
LEFT JOIN wms_inventory as wi ON wir.inventorySid = wi.sid |
|
|
|
LEFT JOIN wms_warehouse_info as i ON wir.warehouseSid = i.sid |
|
|
|
LEFT JOIN wms_warehouse_rack as wr ON wir.warehouseRackSid = wr.sid |
|
|
|
LEFT JOIN wms_warehouse_area as wa ON wr.locationSid = wa.sid |
|
|
|
LEFT JOIN wms_warehouse_zone as wz ON wr.zoneSid = wz.sid |
|
|
|
LEFT JOIN wms_warehouse_info as i ON wr.warehouseSid = i.sid |
|
|
|
LEFT JOIN anrui_portal.sys_organization as s ON wi.useOrgSid = s.sid |
|
|
|
LEFT JOIN anrui_portal.sys_user as u ON wir.createBySid = u.sid |
|
|
|
LEFT JOIN anrui_portal.sys_staffinfo as ui ON u.staffSid = ui.sid |
|
|
@ -193,9 +198,9 @@ |
|
|
|
|
|
|
|
<select id="selByGoodsID" resultType="java.lang.String"> |
|
|
|
SELECT |
|
|
|
billNo |
|
|
|
billNo |
|
|
|
FROM |
|
|
|
wms_inventory_record |
|
|
|
wms_inventory_record |
|
|
|
WHERE billType = '0' |
|
|
|
AND goodsID = #{content} |
|
|
|
</select> |
|
|
|