李宇
2021-08-06 d629fe1ff6a7c9c720e5ab94c8eb07a737b4dc0f
src/main/java/com/nanometer/smartlab/dao/SysReagentDao.xml
@@ -118,6 +118,7 @@
    AND f.user_id= #{user}
    WHERE f.id IS NOT NULL
    and sr.valid_flag = 1
    and supplier.valid_flag = 1
    and sr.type != 3
    <if test="cas != null and cas != ''">
      and sr.cas like concat("%", #{cas} ,"%")
@@ -149,6 +150,7 @@
    AND f.user_id = #{user}
    AND f.id IS NULL
    where sr.valid_flag = 1
    and supplier.valid_flag = 1
    and sr.type != 3
    <if test="cas != null and cas != ''">
      and sr.cas like concat("%", #{cas} ,"%")
@@ -247,13 +249,12 @@
  <select id="getSysReagentListNew" parameterType="java.util.Map" resultMap="SysReagent">
    select sr.*, ss.meta_value as product_home_name, ifnull(w.reserve,0)  as reserve, bm.meta_value as control_products_name,supplier.name as supplierName
    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
    left join (select reagent_id, sum(reserve) reserve from ope_warehouse_reserve where valid_flag = 1 group by reagent_id) w on w.reagent_id = sr.id
    left join sys_supplier supplier on supplier.id = sr.supplier_id
    where sr.valid_flag = 1
    and supplier.valid_flag = 1
    <if test="cas != null and cas != ''">
      and sr.cas = #{cas}
    </if>
@@ -299,6 +300,7 @@
    left join sys_supplier supplier on supplier.id = sr.supplier_id
    LEFT JOIN favor f on f.reagent_id = sr.id AND f.user_id = #{user}
    where sr.valid_flag = 1
    and supplier.valid_flag = 1
    <if test="cas != null and cas != ''">
      and sr.cas like concat("%", #{cas} ,"%")
    </if>
@@ -316,7 +318,9 @@
  <select id="getSysReagentTotalCountNew" parameterType="java.util.Map" resultType="int">
    select count(1)
    from sys_reagent as sr
    LEFT JOIN sys_supplier ss on ss.id = sr.supplier_id
    where sr.valid_flag = 1
    and ss.valid_flag = 1
    <if test="cas != null and cas != ''">
        and sr.cas = #{cas}
    </if>