use LA24030_LuLiPackageLine GO /** ** 机器人缓存库的空闲库位查询视图 **/ IF EXISTS(SELECT 1 FROM sys.views WHERE name='V_EmptyStation') DROP VIEW V_EmptyStation GO CREATE VIEW V_EmptyStation 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 FROM dbo.wms_base_place as station LEFT JOIN dbo.wms_stock_quan as svs ON station.placeCode=svs.placeCode WHERE station.IsDisabled=0 AND station.IsDelete=0 AND station.PlaceStatus=1 -- 1表示 正常 AND station.PlaceCode <> '040310' -- 040310 许工说这个工位机器人达不到,强行锁定 【Editby shaocx,2024-12-23】 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