2021-09-16 10.03.sql 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. USE [befri_Goldhoo]
  2. GO
  3. /****** Object: View [shop_order].[V_SalesItem] Script Date: 2021/9/16 10:03:11 ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8. ALTER VIEW [shop_order].[V_SalesItem]
  9. AS
  10. SELECT i.InventoryTypeId AS ItemType, i.InventoryId AS ItemId, i.InventoryNumber AS ItemNumber,
  11. i.InventoryName AS ItemName, i.AliasName, i.Spec, i.CostPrice, i.SalesPrice, i.SearchCode, i.InventoryCategoryId,
  12. i.IsCustomizable, i.Added, i.Status, i.IsHot, i.IsNew, i.Description, i.IsClearance, i.IsDiscount, i.PriceType,
  13. ic.CategoryNumber, ic.CategoryName, ic.DisplayOrder, vimi.ThumbnailUrl AS MasterImageUrl, vimi.HandledUrl,
  14. ZH.InventoryName AS ZHInvName, ZH.InventoryNumber AS ZHInvNumber, DZ.InventoryName AS DZInvName,
  15. DZ.InventoryNumber AS DZInvNumber, ii.Introduction, i.DeliveryCycle, i.DeliveryCycleStr, i.ProductionProperty,
  16. vtmp.Text AS ProductionPropertyText, i.ModifiedOn, i.Price
  17. FROM basedata.Inventory AS i LEFT OUTER JOIN
  18. basedata.InventoryCategory AS ic ON i.InventoryCategoryId = ic.InventoryCategoryId LEFT OUTER JOIN
  19. basedata.V_InventoryMasterImage AS vimi ON i.InventoryId = vimi.InventoryId LEFT OUTER JOIN
  20. basedata.CombtItemMember AS Co ON Co.CombtItemId = i.InventoryId LEFT OUTER JOIN
  21. basedata.Inventory AS ZH ON ZH.InventoryId = Co.SuitId LEFT OUTER JOIN
  22. basedata.CustomItemMember AS Cu ON Cu.CustomItemId = i.InventoryId LEFT OUTER JOIN
  23. basedata.Inventory AS DZ ON DZ.InventoryId = Cu.MemberItemId LEFT OUTER JOIN
  24. basedata.InventoryIntro AS ii ON i.InventoryId = ii.InventoryId LEFT OUTER JOIN
  25. dbo.ValueTextMap AS vtmp ON i.ProductionProperty = vtmp.Value AND vtmp.TableName = 'basedata.Inventory' AND
  26. vtmp.FieldName = 'ProductionProperty'
  27. GO