货品档案列表.sql 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. SELECT t1.itemid,
  2. t1.itemno,
  3. t1.itemname,
  4. t1.model,
  5. t1.spec,
  6. t1.marketprice,
  7. t2.unitname,
  8. t1.unitid,
  9. t1.createdate,
  10. t1.isonsale,
  11. t1.status,
  12. t1.orderaddqty,
  13. t1.orderminqty,
  14. t1.remarks,
  15. t1.barcode,
  16. t1.skucontrol,
  17. t1.batchcontrol,
  18. t1.grossweight,
  19. t1.weight,
  20. t1.height,
  21. t1.width,
  22. t1.length,
  23. t1.delivery,
  24. t1.istool,
  25. t1.volume,
  26. t1.marketingcategory,
  27. t1.ismodule,
  28. t1.packageqty,
  29. t1.iswoodproducts,
  30. t1.financeclasstype,
  31. t1.color,
  32. t1.cheek,
  33. t1.delistingstatus,
  34. t1.stockno,
  35. t1.widthschemeid,
  36. t1.lengthschemeid,
  37. t1.iscustomsize,
  38. t1.customprice,
  39. t1.pricingmetod,
  40. t1.saleprice,
  41. t1.soldbase,
  42. t1.saleqty,
  43. t1.byname,
  44. t1.cost,
  45. t1.grossprofit,
  46. t1.grossprofitmargin,
  47. t1.rate,
  48. t1.grade,
  49. t1.custamount,
  50. t1.safeqty,
  51. t1.icaddqty,
  52. t1.icminqty,
  53. t1.iswriteoff,
  54. t1.isnegative,
  55. t1.ispartorderautocheck,
  56. t1.islimitemparts,
  57. t1.itemname_print,
  58. t1.applicablegassource,
  59. t1.hygienelicensenum,
  60. t1.departmentid,
  61. t1.executionstandards,
  62. t1.itemclsnum,
  63. t1.outplace,
  64. t1.shapesize,
  65. t1.topclassnum,
  66. t6.auxunitid,
  67. t6.unitgroupname,
  68. t7.unitname axunitname,
  69. t8.caliber,
  70. t8.pressure,
  71. t8.material,
  72. t8.butterflyplatedrive,
  73. t8.connection,
  74. t8.valveplatematerial,
  75. t8.bodymaterial,
  76. t8.actuatortype,
  77. t8.actuatorbrand,
  78. t8.isbutterfly,
  79. t8.erpitemno,
  80. t8.erpitemname,
  81. t8.specalnote,
  82. t8.prodline,
  83. t8.device,
  84. t4.schemename widthschemename,
  85. t5.schemename lengthschemename,
  86. t9.price price1,
  87. t10.price price2,
  88. t11.price price3,
  89. t12.price price4,
  90. t13.price price5,
  91. t14.depname,
  92. t15.stockname
  93. FROM plm_item t1
  94. LEFT JOIN plm_unit t2 ON t2.unitid = t1.unitid AND t2.siteid = t1.siteid
  95. LEFT JOIN plm_unitgroup t6 ON t6.unitgroupid = t1.unitgroupid
  96. LEFT JOIN plm_unit t7 ON t7.unitid = t6.unitid AND t7.siteid = t6.siteid
  97. LEFT JOIN plm_itemextend t8 ON t8.itemid = t1.itemid AND t8.siteid = t1.siteid
  98. left join sa_sizecustomizedscheme t4 on t1.widthschemeid=t4.sa_sizecustomizedschemeid and t1.siteid=t4.siteid
  99. left join sa_sizecustomizedscheme t5 on t1.lengthschemeid=t5.sa_sizecustomizedschemeid and t1.siteid=t5.siteid
  100. left join sa_itemprice t9 on t9.itemid = t1.itemid AND t9.siteid = t1.siteid and t9.pricegrade=1
  101. left join sa_itemprice t10 on t10.itemid = t1.itemid AND t10.siteid = t1.siteid and t10.pricegrade=2
  102. left join sa_itemprice t11 on t11.itemid = t1.itemid AND t11.siteid = t1.siteid and t11.pricegrade=3
  103. left join sa_itemprice t12 on t12.itemid = t1.itemid AND t12.siteid = t1.siteid and t12.pricegrade=4
  104. left join sa_itemprice t13 on t12.itemid = t1.itemid AND t12.siteid = t1.siteid and t12.pricegrade=5
  105. LEFT JOIN sys_department t14 ON t14.departmentid = t1.departmentid AND t14.siteid = t1.siteid
  106. LEFT JOIN st_stock t15 ON t15.stockno = t1.stockno AND t15.siteid = t1.siteid
  107. WHERE t1.siteid = $siteid$
  108. and $where$