1234567891011121314151617181920212223242526 |
- <?xml version="1.0" encoding="utf-8" ?>
- <select>
- <selectstr>
- select u_mtrl_price.mtrlid,
- u_mtrl_price.name as mtrlname,
- ISNULL(u_mtrl_price_pricelist.price, 0) AS pricelistprice
- from u_mtrl_price
- LEFT JOIN u_mtrl_price_pricelist ON u_mtrl_price.mtrlid = u_mtrl_price_pricelist.mtrlid
- </selectstr>
- <where>
- <when>
- u_mtrl_price.mtrltype = 2
- </when>
- <when notnull="@arg_pricelistid">
- u_mtrl_price_pricelist.pricelistid = @arg_pricelistid
- </when>
- <when notnull="@arg_bednetid" arg_bednetid!="0">
- u_mtrl_price_pricelist.pricelistid = (select pricelistid from u_dept where deptid = (select deptid from u_bednet where bednetid = @arg_bednetid))
- </when>
- <when notnull="@arg_deptid">
- u_mtrl_price_pricelist.pricelistid = (select pricelistid from u_dept where deptid = @arg_deptid)
- </when>
- </where>
- <displayfields>
- </displayfields>
- </select>
|