
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 svs.Id IS NULL 

GO