<?xml version="1.0" encoding="utf-8" ?>
<select>
	<selectstr>
		SELECT
			u_mattress_extra_type.extraid
			,extramxid
			,extramxname
			,u_mattress_extra_type.typeid
			,price
			,dscrp
			,qty
			,u_mattress_extra.inuse
			,inputtype
			,ifinit
		From u_mattress_extra
		inner join u_mattress_extra_type on u_mattress_extra_type.extraid = u_mattress_extra.extraid
			AND u_mattress_extra_type.inuse = 0
	</selectstr>
	<where>
		<when notnull="@arg_extraid" arg_extraid!="0">
			u_mattress_extra_type.extraid = @arg_extraid
		</when>
		<when notnull="@arg_typeid">
			u_mattress_extra_type.typeid = @arg_typeid
		</when>
		<when notnull="@arg_ifinit">
			u_mattress_extra.ifinit = @arg_ifinit
		</when>
	</where>
	<displayfields>
		<field field="pid" compute="getrow()">序</field>
		<field field="extraid" mapper="u_mattress_extra_type.mattressextra">项目类型</field>
		<field field="extramxname">项目名称</field>
		<field field="price" datatype="number">金额</field>
		<field field="qty" datatype="number">数量</field>
		<field field="dscrp">备注</field>
		<field field="ifinit" datatype="checkbox">自动导入</field>
		<field field="inputtype" mapper="">录入类型</field>
		<field field="inuse" datatype="checkbox">禁用</field>
	</displayfields>
</select>
