_Mapper_mtrl2.xml 878 B

1234567891011121314151617181920212223242526
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <select>
  3. <selectstr>
  4. select u_mtrl_price.mtrlid,
  5. u_mtrl_price.name as mtrlname,
  6. ISNULL(u_mtrl_price_pricelist.price, 0) AS pricelistprice
  7. from u_mtrl_price
  8. LEFT JOIN u_mtrl_price_pricelist ON u_mtrl_price.mtrlid = u_mtrl_price_pricelist.mtrlid
  9. </selectstr>
  10. <where>
  11. <when>
  12. u_mtrl_price.mtrltype = 2
  13. </when>
  14. <when notnull="@arg_pricelistid">
  15. u_mtrl_price_pricelist.pricelistid = @arg_pricelistid
  16. </when>
  17. <when notnull="@arg_bednetid" arg_bednetid!="0">
  18. u_mtrl_price_pricelist.pricelistid = (select pricelistid from u_dept where deptid = (select deptid from u_bednet where bednetid = @arg_bednetid))
  19. </when>
  20. <when notnull="@arg_deptid">
  21. u_mtrl_price_pricelist.pricelistid = (select pricelistid from u_dept where deptid = @arg_deptid)
  22. </when>
  23. </where>
  24. <displayfields>
  25. </displayfields>
  26. </select>