web_mtrl_choose.xml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <select>
  3. <selectstr>
  4. SELECT
  5. u_mtrl_price.mtrlid,
  6. u_mtrl_price.mtrltype,
  7. u_mtrl_price.name AS mtrlname,
  8. u_mtrl_price.priceunit,
  9. u_mtrl_price.shrinkage AS price,
  10. u_mtrl_price.gram_weight,
  11. u_mtrl_price.cloth_width,
  12. u_mtrl_price.if_inputqty,
  13. u_mtrl_price.if_areaprice,
  14. u_mtrl_price.thickness,
  15. u_mtrl_price.dscrp,
  16. u_mtrl_price.createtime,
  17. u_mtrl_price.createby,
  18. ISNULL(u_mtrl_price_pricelist.price, 0) AS pricelistprice,
  19. ISNULL(u_mtrl_price_pricelist.price_formula, '') AS price_formula,
  20. u_mtrl_price.erp_mtrlid,
  21. SPACE(200) AS erp_mtrlcode,
  22. SPACE(200) AS erp_mtrlname,
  23. SPACE(200) AS erp_mtrlmode,
  24. SPACE(200) AS erp_unit,
  25. SPACE(200) AS erp_mtrlengname
  26. FROM u_mtrl_price
  27. LEFT JOIN u_mtrl_price_pricelist ON u_mtrl_price.mtrlid = u_mtrl_price_pricelist.mtrlid
  28. </selectstr>
  29. <where>
  30. <when notnull="@keyword">
  31. u_mtrl_price.name like '%'+ @keyword + '%' OR u_mtrl_price.dscrp like '%'+ @keyword + '%' OR u_mtrl_price.mtrlid like '%'+ @keyword + '%'
  32. </when>
  33. <when>
  34. u_mtrl_price.isuse = 1
  35. </when>
  36. <when>
  37. u_mtrl_price.lastdate >= GETDATE()
  38. </when>
  39. <when notnull="@arg_mtrltype">
  40. u_mtrl_price.mtrltype = @arg_mtrltype
  41. OR ( @arg_mtrltype = 200 AND u_mtrl_price.mtrlid IN (8727, 8728, 47414) )
  42. </when>
  43. <when notnull="@arg_pricelistid">
  44. u_mtrl_price_pricelist.pricelistid = @arg_pricelistid
  45. OR u_mtrl_price.mtrlid NOT IN (SELECT mtrlid FROM u_mtrl_price_pricelist WHERE pricelistid = @arg_pricelistid)
  46. </when>
  47. <when notnull="@arg_mtrlid">
  48. u_mtrl_price.mtrlid = @arg_mtrlid
  49. </when>
  50. </where>
  51. <displayfields>
  52. <field field="pid" compute="getrow()">序</field>
  53. <field field="mtrlname">名称</field>
  54. <field field="thickness">厚度</field>
  55. <field field="priceunit">单位</field>
  56. <field field="pricelistprice" funcid="96">单价</field>
  57. <field field="dscrp" table="u_mtrl_price">备注</field>
  58. <field field="erp_mtrlcode">L1编码</field>
  59. <field field="erp_mtrlname">L1名称</field>
  60. <field field="erp_mtrlmode">L1规格</field>
  61. <field field="erp_unit">L1单位</field>
  62. <field field="erp_mtrlengname">L1英文名称</field>
  63. </displayfields>
  64. </select>