<?xml version="1.0" encoding="utf-8" ?>
<select>
	<selectstr>
		SELECT
			bednetmx_partid,
			u_bednetmx_spring.bednetmxid,
			u_bednetmx_spring.springid,
			ISNULL(vv_spring.name, '') as springname,
			u_bednetmx_spring.spring_qty_width,
			u_bednetmx_spring.spring_qty_length,
			u_bednetmx_spring.fabrics1_mtrl_cost,
			u_bednetmx_spring.spring_mtrl_cost,
			u_bednetmx_spring.spring_mtrl_cost_replace_formula,
			u_bednetmx_spring.spring_weight_replace_formula
		From u_bednetmx_spring

		left outer join u_bednetmx on u_bednetmx.bednetmxid = u_bednetmx_spring.bednetmxid
		left outer join (
		SELECT u_spring.springid,
		left(rtrim(cast(u_spring.line_diameter as char(10))),4) + '/'+
		left(rtrim(cast(u_spring.height as char(10))),4) + '/'+
		left(rtrim(cast(u_spring.caliber  as char(10))),4) + '/'+
		left(rtrim(cast(u_spring.center_diameter  as char(10))),4) + '/'+
		left(rtrim(cast(u_spring.cyclenum  as char(10))),4)   as name
		FROM u_spring
		) vv_spring on vv_spring.springid = u_bednetmx_spring.springid
	</selectstr>
	<where>
		<when notnull="@arg_bednetmxid">
			u_bednetmx_spring.bednetmxid = @arg_bednetmxid
		</when>
		<when notnull="@arg_bednetid">
			u_bednetmx.bednetid = @arg_bednetid
		</when>
	</where>
	<displayfields>
		<field field="pid" compute="getrow()">
			序
		</field>
		<field field="springname">
			弹簧
		</field>
		<field field="spring_qty_width" datatype="integer">
			弹簧排列
			个数-宽
		</field>
		<field field="spring_qty_length" datatype="integer">
			弹簧排列
			个数-长
		</field>
		<field field="spring_mtrl_cost" usermode_notequals="1">弹簧材料总成本</field>
		<field field="spring_mtrl_cost_replace_formula" usermode_notequals="1">弹簧材料总成本替换公式</field>
		<field field="spring_weight_replace_formula" usermode_notequals="1">钢丝重量替换公式</field>
	</displayfields>
</select>
