insert
product (name,father,unit,state,create_time,update_time,version,specifications_id)
value (#{name},#{father},#{unit},1,#{createTime},#{updateTime},#{version},#{specifications_id})
select p.name, unit, required, internal
from lims_laboratory.product p,
lims_laboratory.specifications sp,
lims_laboratory.standard st
where specifications_id = sp.id
and standard_id = st.id
and material_id = #{materialId}
select id,
name,
father,
unit,
required,
internal,
version
from lims_laboratory.product
where state = 1
and specifications_id = #{specificationsId}
and version = #{version}
ORDER BY product.`create_time` DESC
update lims_laboratory.product
set state=0
where id in (${ids})
select distinct version
from lims_laboratory.product
where state = 1
and specifications_id = #{specificationsId}
order by version desc
select id, father, name
from lims_laboratory.product
where state = 1
and specifications_id = #{modelId}
select id,
name,
father,
unit,
required,
internal,
version
from lims_laboratory.product
where state = 1
and specifications_id = #{specificationId}
and version = #{version}
and father = #{exper}
select id,
name,
unit,
required,
internal,
version
from lims_laboratory.product
where state = 1
and specifications_id = #{specificationId}
and version = #{version}
and name = #{exper}
and father is null