| | |
| | | <result property="unitName" column="unitName"></result> |
| | | <result property="formatName" column="formatName"></result> |
| | | <result property="safetynum" column="safetynum"></result> |
| | | <result property="density" column="density"></result> |
| | | </resultMap> |
| | | |
| | | <sql id="queryWhereSql"> |
| | |
| | | bm.meta_value AS control_products_name, |
| | | supplier. NAME AS supplierName, |
| | | f.id favor, |
| | | f.create_time favortime |
| | | f.create_time favortime, |
| | | supplier.valid_flag as supplierFlag |
| | | FROM |
| | | sys_reagent AS sr |
| | | LEFT JOIN base_meta AS ss ON sr.product_home = ss.id |
| | |
| | | and sr.product_sn like concat("%", #{productSn} ,"%") |
| | | </if> |
| | | UNION ALL |
| | | SELECT |
| | | (SELECT |
| | | sr.*, |
| | | ss.meta_value AS product_home_name, |
| | | ss.order_index, |
| | | bm.meta_value AS control_products_name, |
| | | supplier.NAME AS supplierName, |
| | | f.id favor, |
| | | f.create_time favortime |
| | | f.create_time favortime, |
| | | supplier.valid_flag as supplierFlag |
| | | FROM |
| | | sys_reagent AS sr |
| | | LEFT JOIN base_meta AS ss ON sr.product_home = ss.id |
| | |
| | | <if test="MaxSize != null"> |
| | | limit #{MaxSize} |
| | | </if> |
| | | ) |
| | | ) as reagent |
| | | ORDER BY reagent.favortime DESC,length(reagent.name),reagent.order_index,price asc |
| | | <if test="first != null and pageSize != null"> |
| | |
| | | |
| | | |
| | | <select id="favorList" parameterType="java.util.Map" resultMap="SysReagent"> |
| | | select sr.*, ss.meta_value as product_home_name, bm.meta_value as control_products_name,supplier.name as supplierName,f.id favor,f.create_time favortime |
| | | select sr.*, ss.meta_value as product_home_name, |
| | | bm.meta_value as control_products_name, |
| | | supplier.name as supplierName, |
| | | f.id favor, |
| | | f.create_time favortime, |
| | | supplier.valid_flag as supplierFlag |
| | | from sys_reagent as sr |
| | | left join base_meta as ss on sr.product_home = ss.id |
| | | left join base_meta bm on bm.id = sr.control_products |
| | |
| | | |
| | | |
| | | <insert id="insertSysReagent" parameterType="com.nanometer.smartlab.entity.SysReagent"> |
| | | 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}) |
| | | 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,density) |
| | | values (#{id}, #{name}, #{cas}, #{reagentType}, #{reagentCharacter}, #{supplierId}, #{reagentFormat}, #{mainMetering}, #{reagentUnit}, #{price}, #{perBox}, #{memo}, 1, now(), now(),#{deadline}, #{productSn}, #{dangerousFlag},#{controlProducts},#{productHome},#{type},#{density}) |
| | | </insert> |
| | | |
| | | <update id="updateSysReagent" parameterType="com.nanometer.smartlab.entity.SysReagent"> |
| | | 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} |
| | | ,product_home=#{productHome},type=#{type},density = #{density} |
| | | where id=#{id} |
| | | </update> |
| | | |
| | |
| | | set safetynum = #{safetynum} |
| | | where id = #{id} |
| | | </update> |
| | | <update id="updateSysReagentPriceById"> |
| | | update sys_reagent |
| | | set price = #{price} |
| | | where id = #{reagentId} |
| | | |
| | | <select id="countReagentByDetail" resultMap="SysReagent"> |
| | | </update> |
| | | |
| | | <select id="countReagentByDetail" resultMap="SysReagent"> |
| | | select |
| | | * |
| | | from sys_reagent as sr |
| | |
| | | c.meta_value formatName, |
| | | d.meta_value product_home_name, |
| | | e.meta_value control_products_name, |
| | | s.name AS supplierName |
| | | s.name AS supplierName, |
| | | s.valid_flag as supplierFlag |
| | | from sys_reagent a |
| | | left join base_meta b on b.id=a.reagent_unit |
| | | left join base_meta c on c.id=a.reagent_format |