<?xml version="1.0" encoding="utf-8" ?>
<select>
  <selectstr>
SELECT u_bednet_varmx.varid AS varid
	,varkind
	,varcode
	,varname
	,varclass
	,vartype
	,varunit
	,u_bednet_varmx.varvalue AS varvalue
	,dscrp
	,createtime
	,createby
FROM u_bednet_var
INNER JOIN u_bednet_varmx ON u_bednet_varmx.varid = u_bednet_var.varid
WHERE (
		varkind = @varkind
		OR @varkind = - 1
		)
	AND (u_bednet_varmx.pricelistid = @pricelistid)
	AND (
		(
			u_bednet_var.varclass = 1
			AND (
				u_bednet_varmx.bednettypeid = @bednettypeid
				OR @bednettypeid = 0
				)
			)
		OR (u_bednet_var.varclass = 0)
		)
  </selectstr>
  <where>
  </where>
  <displayfields>
  </displayfields>
</select>
