and sr.name like #{name}
and sr.cas like #{cas}
and sr.supplier_id = #{supplierId}
and sr.id != #{editId}
and sr.name = #{deadline}
and sr.product_sn like #{productSn}
and sr.type = #{type}
insert into sys_reagent(id, name, cas, reagent_type, reagent_character, supplier_id, reagent_format, main_metering, reagent_unit, price, per_box, memo, valid_flag, create_time, update_time,deadline, product_sn, dangerous_flag,control_products,product_home,type)
values (#{id}, #{name}, #{cas}, #{reagentType}, #{reagentCharacter}, #{supplierId}, #{reagentFormat}, #{mainMetering}, #{reagentUnit}, #{price}, #{perBox}, #{memo}, 1, now(), now(),#{deadline}, #{productSn}, #{dangerousFlag},#{controlProducts},#{productHome},#{type})
update sys_reagent set name=#{name}, cas=#{cas}, reagent_type=#{reagentType}, reagent_character=#{reagentCharacter}, supplier_id=#{supplierId}, reagent_format=#{reagentFormat},
main_metering=#{mainMetering}, reagent_unit=#{reagentUnit}, price=#{price}, per_box=#{perBox}, memo=#{memo}, update_time=now(), deadline = #{deadline}, product_sn = #{productSn}, dangerous_flag = #{dangerousFlag}, control_products = #{controlProducts}
,product_home=#{productHome},type=#{type}
where id=#{id}
update sys_reagent set name=#{name}, reagent_type=#{reagentType}, reagent_character=#{reagentCharacter}, supplier_id=#{supplierId}, reagent_format=#{reagentFormat},type=#{type},
main_metering=#{mainMetering}, reagent_unit=#{reagentUnit}, price=#{price}, per_box=#{perBox}, memo=#{memo}, update_time=now(), deadline = #{deadline}, product_sn = #{productSn}, dangerous_flag = #{dangerousFlag}, control_products = #{controlProducts}
where
cas = #{cas}
cas is null
and main_metering = #{mainMetering}
and main_metering is null
and reagent_unit=#{reagentUnit}
and reagent_unit is null
and reagent_format=#{reagentFormat}
and reagent_format is null
and product_home = #{productHome}
and product_home is null
update sys_reagent set valid_flag=0, update_time=now()
where id in
#{item}