select uid_0,name_0,isnull(example_0,'') example_0
from rb_productType
where web_show_0=1
and puid_0 = #{uid_0}
and puid_0 = 0
order by order_0
select model_ext_0 as name_0 from rb_productType A
inner join [rb_material_redbook_ext] B on A.name_0=B.model_0
where A.uid_0 = #{uid_0} and B.show_0=1
select #{uid_0} uid_0,name_0 from (
select name_0,1 order_0 from rb_productType where uid_0 = #{uid_0}
union all
select model_ext_0 as name_0,B.order_0
from rb_productType A
inner join [rb_material_redbook_ext] B on A.name_0=B.model_0
where A.uid_0 = #{uid_0} and B.show_0=1 and isnull(B.type_uid_0,0)=0
union all
select model_ext_0 as name_0,B.order_0
from rb_productType A
inner join [rb_material_redbook_ext] B on A.uid_0=B.type_uid_0
where A.uid_0 = #{uid_0} and B.show_0=1
) A order by order_0
select A.uid_0,A.name_0,cast(cast(B.截面 as float) as nvarchar(20)) 截面
from rb_productType A
left join p_section B on A.uid_0=B.type_uid_0
where A.uid_0 = #{uid_0} and 截面 is not null order by A.name_0,B.截面
select A.uid_0,A.name_0,cast(cast(B.截面 as float) as nvarchar(20)) section
from rb_productType A
left join p_section B on A.uid_0=B.type_uid_0
where A.uid_0 = #{uid_0} and B.model_0 = #{name_0} and 截面 is not null order by A.name_0,B.截面
select B.uid_0,A.namevoltage name_0,isnull(A.电压等级,N' - ') voltage ,A.单位 stu,A.型号 model,isnull(A.规格,'') spec ,
convert(decimal,convert(float,A.红本价格)) price,convert(varchar(10),B.date_0,23) pricedate
from [rb_product_price] A
left join rb_productVersion B on A.version_uid_0=B.uid_0
where B.sta_0=1 and A.type_uid_0 = #{uid_0}
and A.截面 = #{section}
and A.型号 = #{name_0} order by A.order_0
select B.uid_0,A.namevoltage name_0,isnull(A.电压等级,N' - ') voltage ,A.单位 stu,A.型号 model,isnull(A.规格,'') spec ,
convert(decimal,convert(float,A.红本价格)) price,convert(varchar(10),B.date_0,23) pricedate
from [rb_product_price] A
left join rb_productVersion B on A.version_uid_0=B.uid_0
where B.sta_0=1
and A.型号 like '%${name_0}%'
and A.规格 = #{model}
order by len(A.namevoltage)
insert into OAQuot
quot_id,
quotCode,
quotCustomer,
quotProject,
quotLxr,
quotLxrdh,
totalPrice,
rbDateUid,
create_by,
create_time,
update_by,
update_time,
#{quot_id},
#{quotCode},
#{quotCustomer},
#{quotProject},
#{quotLxr},
#{quotLxrdh},
#{totalPrice},
#{rbDateUid},
#{createBy},
#{createTime},
#{updateBy},
#{updateTime},
update OAQuot
quotCode = #{quotCode},
quotCustomer = #{quotCustomer},
quotProject = #{quotProject},
quotLxr = #{quotLxr},
quotLxrdh = #{quotLxrdh},
totalPrice = #{totalPrice},
rbDateUid = #{rbDateUid},
quotApprovalStatus = #{quotApprovalStatus},
create_by = #{createBy},
create_time = #{createTime},
update_by = #{updateBy},
update_time = #{updateTime},
where quot_id = #{quot_id}
insert into OAQuotProduct(quot_product_id, name_0, name_1, spec, voltage,stu,price,setPrice,count,allPrice,per,per2,quot_id,number) values
( #{item.quot_product_id}, #{item.name_0}, #{item.name_1}, #{item.spec}, #{item.voltage}, #{item.stu},cast(#{item.price,jdbcType=DECIMAL} as decimal(18,2)),cast(#{item.setPrice,jdbcType=DECIMAL} as decimal(18,2)), cast(#{item.count,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.allPrice,jdbcType=DECIMAL} as decimal(18,2)),cast(#{item.per,jdbcType=DECIMAL} as decimal(18,2)),cast(#{item.per2,jdbcType=DECIMAL} as decimal(18,2)), #{item.quot_id}, #{item.index})
select uid_0 value,
convert(varchar(10),[date_0],23)+' 铜:'+convert(varchar(10),[tong_price_0])+' 铝:'+convert(varchar(10),[lv_price_0]) label
from [rb_productVersion] A
inner join (select max(uid_0) muid from rb_productVersion
where sta_0=1 or sta_0=0 group by date_0 )B on A.uid_0=B.muid
order by sta_0 desc,uid_0 desc
SELECT a.红本价格 AS setPrice, a.namevoltage AS name_0, a.规格 AS spec, a.电压等级 AS voltage
FROM rb_product_price a
JOIN (VALUES
#{param.uid_0}, #{param.name_0}, #{param.spec}, #{param.voltage}
) AS v(version_uid_0,产品型号, 规格, 电压等级)
ON a.version_uid_0 = v.version_uid_0
AND a.namevoltage = v.产品型号
AND a.规格 = v.规格
AND a.电压等级 = v.电压等级
select top 1 红本价格 from rb_product_price A
inner join [rb_productVersion] B on A.version_uid_0=B.uid_0
where A.[namevoltage] = #{name_0} and A.规格 = #{spec}
and A.电压等级 = #{voltage} and B.uid_0 = #{uid_0}
and (B.sta_0=1 or sta_0=0)
select top 1 B.uid_0,A.namevoltage name_0,isnull(A.电压等级,N' - ') voltage ,A.单位 stu,
convert(decimal,convert(float,A.红本价格)) price,convert(varchar(10),B.date_0,23) pricedate
from [rb_product_price] A
left join rb_productVersion B on A.version_uid_0=B.uid_0
where A.型号 = #{name_1} and A.规格 = #{spec} and UPPER(A.电压等级) = #{voltage}
and B.uid_0 = #{uid_0}
and (B.sta_0=1 or sta_0=0)
select top 1 B.uid_0,A.namevoltage name_0,isnull(A.电压等级,N' - ') voltage,A.单位 stu,
A.型号 name_1,isnull(A.规格,'') spec
,convert(decimal,convert(float,A.红本价格)) price,convert(varchar(10),B.date_0,23) pricedate
from [rb_product_price] A
left join rb_productVersion B on A.version_uid_0=B.uid_0
where (B.sta_0=1 or sta_0=0) and A.namevoltage=#{name_0}
and B.uid_0 = #{uid_0}
LEFT JOIN sys_user u on u.user_name=a.create_by
LEFT JOIN sys_dept d on u.dept_id = d.dept_id
select a.quot_id,a.quotCode,a.quotCustomer,a.quotProject,a.quotLxr,a.quotLxrdh,a.totalPrice,a.quotApprovalStatus,
a.create_by,u.nick_name createName,a.create_time createTime,
a.update_by,a.update_time updateTime
from OAQuot a
and datediff(d, a.create_time, #{params.beginTime}) 0
and datediff(d, a.create_time, #{params.endTime}) =]]> 0
and a.quotCustomer like '%${quotCustomer}%'
and a.quotApprovalStatus = #{quotApprovalStatus}
${params.dataScope}
order by a.quotCode desc
select a.quot_id, a.quotCode, a.quotCustomer, a.quotProject, a.quotLxr,
a.quotLxrdh, a.totalPrice,a.rbDateUid,a.quotApprovalStatus,
b.quot_product_id, b.name_0, b.name_1,
b.spec, b.voltage, b.stu,
b.per,b.per2,b.price,b.setPrice,b.count,b.allPrice,b.quot_id
from OAQuot a
left join OAQuotProduct b on b.quot_id = a.quot_id
where a.quot_id = #{quotId} order by b.number
delete from OAQuot where quot_id = #{quotId}
delete from OAQuotProduct where quot_id = #{quotId}
select top 1 muid from
(
select max(uid_0) muid,date_0 from rb_productVersion
where sta_0=1 or sta_0=0 group by date_0
)a order by date_0 desc
{call GetSerialNo(#{type,mode=IN,jdbcType=VARCHAR})}