|
@@ -39,7 +39,9 @@
|
|
|
u_mattress_mx_mtrl.replace_useformula ,
|
|
|
u_mattress_mx_mtrl.gydscrp,
|
|
|
u_mattress_mx_mtrl.mattress_width,
|
|
|
- u_mattress_mx_mtrl.mattress_length
|
|
|
+ u_mattress_mx_mtrl.mattress_length,
|
|
|
+ CASE WHEN u_mattress_formula.formulatype = 99 THEN vv_bednetmx.spring_qty_width ELSE 0 END AS spring_qty_width,
|
|
|
+ CASE WHEN u_mattress_formula.formulatype = 99 THEN vv_bednetmx.spring_qty_length ELSE 0 END AS spring_qty_length
|
|
|
From u_mattress_mx_mtrl
|
|
|
Left join u_mattress_formula On u_mattress_formula.formulaid = u_mattress_mx_mtrl.formulaid
|
|
|
left outer join u_mtrl_price on u_mattress_mx_mtrl.mtrlid = u_mtrl_price.mtrlid
|
|
@@ -63,6 +65,12 @@
|
|
|
FROM u_bednet
|
|
|
inner join u_bednet_type ON u_bednet_type.bednettypeid = u_bednet.bednettypeid
|
|
|
) as vv_bednet ON vv_bednet.bednetid = u_mattress_mx_mtrl.mtrlid
|
|
|
+ Left OUTER JOIN (
|
|
|
+ SELECT top 1 u_bednetmx.bednetid,
|
|
|
+ u_bednetmx.spring_qty_width,
|
|
|
+ u_bednetmx.spring_qty_length
|
|
|
+ FROM u_bednetmx
|
|
|
+ ) as vv_bednetmx ON vv_bednet.bednetid = u_mattress_mx_mtrl.mtrlid
|
|
|
</selectstr>
|
|
|
<where>
|
|
|
<when notnull="@arg_mattressid">
|