kongzy
2023-11-28 59d9ea33f503e363f2e2941c7c00cc9dd9d9d1c7
src/main/java/com/nanometer/smartlab/dao/SysReagentDao.xml
@@ -30,6 +30,7 @@
    <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">
@@ -177,6 +178,35 @@
    </if>
  </select>
  <select id="reagentSimpleInfoList" resultMap="SysReagent">
    select sr.id,sr.name,sr.cas,sr.product_sn,sr.create_time,sr.update_time,bm.meta_value as reagent_type,bm2.meta_value as reagent_character from sys_reagent sr
    left join base_meta as bm on bm.id=sr.reagent_type
    left join base_meta as bm2 on bm2.id=sr.reagent_character
    <where>
        and sr.valid_flag = 1 and sr.type=1
      <if test="cas != null and cas != ''">
        and sr.cas like concat("%", #{cas} ,"%")
      </if>
      <if test="name != null and name != ''">
        and sr.name like concat("%", #{name} ,"%")
      </if>
    </where>
    order by sr.create_time desc
    limit #{first},#{pageSize}
  </select>
  <select id="reagentSimpleInfoCount" resultType="int">
    select count(1) from sys_reagent sr
    <where>
      and sr.valid_flag = 1 and sr.type=1
      <if test="cas != null and cas != ''">
        and sr.cas like concat("%", #{cas} ,"%")
      </if>
      <if test="name != null and name != ''">
        and sr.name like concat("%", #{name} ,"%")
      </if>
    </where>
  </select>
  <select id="favorList" parameterType="java.util.Map" resultMap="SysReagent">
    select sr.*, ss.meta_value as product_home_name,
@@ -427,14 +457,14 @@
    <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>
@@ -486,8 +516,14 @@
    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