zongzhibin
2024-11-25 5a3f34856055ffbbbe9c2519a52b8be50c6f4562
DBScript/01_DDL/03_DDL_VIEW.sql
@@ -24,4 +24,55 @@
AND station.PlaceStatus=1  -- 1表示 正常
AND svs.Id IS NULL 
GO
 /**
 **  机器人缓存库的库位查询视图
 **/
IF EXISTS(SELECT 1 FROM sys.views WHERE name='V_Station_Quan')
   DROP VIEW V_Station_Quan
GO
CREATE VIEW V_Station_Quan
AS
 SELECT
station.Id, station.PlaceCode, station.PlaceName, station.PlaceType, station.PlaceTypeName, station.[Length],
station.Width, station.Height, station.Thick, station.PlaceStatus, station.AreaId, station.AreaCode, station.AreaName, station.RowNo,
 station.ColumnNo, station.LayerNo, station.LaneNo, station.IsVirtually, station.IsDisabled,
 station.CreateTime, station.UpdateTime, station.CreateUserId, station.CreateUserName, station.UpdateUserId, station.UpdateUserName, station.IsDelete,
 svs.InTime,svs.Upi,svs.DetailName,svs.PlanNo,svs.OrderId,svs.PackageCode,
 svs.Length,svs.Width,svs.Thk,svs.StockStatus,svs.StockStatusName,
  svs.OperReason,svs.OperUser,svs.OperTime,svs.LockStatus,svs.LockReason,svs.LockUser,svs.LockTime
FROM dbo.wms_base_place as station
LEFT JOIN dbo.wms_stock_quan as svs ON station.placeCode=svs.placeCode
GO
/**
 **  机器人缓存库的库存查询视图
 **/
IF EXISTS(SELECT 1 FROM sys.views WHERE name='V_Station_Quan')
   DROP VIEW V_Station_Quan
GO
CREATE VIEW V_Station_Quan
AS
 SELECT
station.Id, station.PlaceCode, station.PlaceName, station.PlaceType, station.PlaceTypeName, station.[Length],
station.Width, station.Height, station.Thick, station.PlaceStatus, station.AreaId, station.AreaCode, station.AreaName, station.RowNo,
 station.ColumnNo, station.LayerNo, station.LaneNo, station.IsVirtually, station.IsDisabled,
 station.CreateTime, station.UpdateTime, station.CreateUserId, station.CreateUserName, station.UpdateUserId, station.UpdateUserName, station.IsDelete,
 svs.InTime,svs.Upi,svs.DetailName,svs.PlanNo,svs.OrderId,svs.PackageCode,
 svs.Length,svs.Width,svs.Thk,svs.StockStatus,svs.StockStatusName,
  svs.OperReason,svs.OperUser,svs.OperTime,svs.LockStatus,svs.LockReason,svs.LockUser,svs.LockTime
FROM dbo.wms_base_place as station
LEFT JOIN dbo.wms_stock_quan as svs ON station.placeCode=svs.placeCode
GO