web_factory_profitratelist.xml 982 B

12345678910111213141516171819202122232425262728293031
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <select>
  3. <selectstr>
  4. SELECT ISNULL(u_factory_profitrate.deptid,v_temp.deptid) AS deptid
  5. ,ISNULL(u_factory_profitrate.bednet_or_mattress,@kind) AS bednet_or_mattress
  6. ,ISNULL(u_factory_profitrate.bednettypeid_mattresstypeid,v_temp.bednettypeid) AS bednettypeid_mattresstypeid
  7. ,ISNULL(u_factory_profitrate.profitrate, 0) AS profitrate
  8. ,u_factory_profitrate.createtime
  9. ,u_factory_profitrate.createby
  10. ,v_temp.deptname
  11. ,v_temp.typename
  12. FROM u_factory_profitrate
  13. RIGHT OUTER JOIN (
  14. SELECT u_dept.deptid
  15. ,u_bednet_type.bednettypeid
  16. ,u_dept.deptname
  17. ,u_bednet_type.typename
  18. FROM u_dept CROSS JOIN u_bednet_type
  19. ) v_temp ON u_factory_profitrate.deptid = v_temp.deptid
  20. AND u_factory_profitrate.bednettypeid_mattresstypeid = v_temp.bednettypeid
  21. </selectstr>
  22. <where>
  23. <when>
  24. ISNULL(u_factory_profitrate.bednet_or_mattress,@kind) = @kind
  25. </when>
  26. </where>
  27. <orderstr>
  28. </orderstr>
  29. <displayfields>
  30. </displayfields>
  31. </select>