<?xml version="1.0" encoding="utf-8" ?>
<select>
	<selectstr>
		SELECT
			springid,
			line_diameter,
			Height,
			caliber,
			center_diameter,
			cyclenum,
			gram_weight,
			dscrp,
			createtime,
			createby,
			springtypeid,
			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
	</selectstr>
	<where>
		<when notnull="@arg_line_diameter" arg_line_diameter!="-1">
			line_diameter LIKE '%' + @arg_line_diameter + '%'
		</when>
		<when notnull="@arg_height" arg_height!="-1">
			Height=@arg_height
		</when>
		<when notnull="@arg_caliber" arg_caliber!="-1">
			caliber=@arg_caliber
		</when>
		<when notnull="@arg_center_diameter" arg_center_diameter!="-1">
			center_diameter=@arg_center_diameter
		</when>
		<when notnull="@arg_cyclenum" arg_cyclenum!="-1">
			cyclenum=@arg_cyclenum
		</when>
		<when notnull="@arg_bedtypeid" arg_bedtypeid!="-1">
			bedtypeid=@arg_bedtypeid
		</when>
		<when notnull="@arg_springtypeid" arg_springtypeid!="-1">
			springtypeid=@arg_springtypeid
		</when>
		<when>
			his_typeid=1
		</when>
		<when notnull="@arg_search">
			u_spring.line_diameter LIKE '%' + @arg_search + '%' OR
			u_spring.height LIKE '%' + @arg_search + '%' OR
			u_spring.caliber LIKE '%' + @arg_search + '%' OR
			u_spring.center_diameter LIKE '%' + @arg_search + '%' OR
			u_spring.cyclenum LIKE '%' + @arg_search + '%'
		</when>
	</where>
	<displayfields>
		<field field="pid" compute="getrow()">序</field>
		<field field="line_diameter" datatype="number">线径MM</field>
		<field field="height" datatype="number">高度CM</field>
		<field field="caliber" datatype="number">口经CM</field>
		<field field="center_diameter" datatype="number">中心直径CM</field>
		<field field="cyclenum" datatype="number">圈数</field>
		<field field="gram_weight" datatype="number">克重KG</field>
		<field field="dscrp">备注</field>
		<field field="createby">等记人</field>
		<field field="createtime" datatype="datetime">登记时间</field>
		<field field="springtypeid" mapper="">弹簧分类</field>
	</displayfields>
</select>
