src/main/java/com/nanometer/smartlab/dao/SysReagentDao.xml
@@ -118,7 +118,7 @@
    AND f.user_id= #{user}
    WHERE f.id IS NOT NULL
    and sr.valid_flag = 1
    and supplier.valid_flag = 1
    and (supplier.valid_flag = 1 or sr.type = 0)
    and sr.type != 3
    <if test="cas != null and cas != ''">
      and sr.cas like concat("%", #{cas} ,"%")
@@ -150,7 +150,7 @@
    AND f.user_id = #{user}
    AND f.id IS NULL
    where sr.valid_flag = 1
    and supplier.valid_flag = 1
    and (supplier.valid_flag = 1 or sr.type = 0)
    and sr.type != 3
    <if test="cas != null and cas != ''">
      and sr.cas like concat("%", #{cas} ,"%")
@@ -183,6 +183,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 or sr.type = 0)
    <choose>
      <when test="favorFlag != ''">
        and f.id is not null
@@ -224,6 +225,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 or sr.type = 0)
    <choose>
      <when test="favorFlag != ''">
       and f.id is not null
@@ -254,7 +256,7 @@
    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
    and (supplier.valid_flag = 1 or sr.type = 0)
    <if test="cas != null and cas != ''">
      and sr.cas = #{cas}
    </if>
@@ -282,7 +284,6 @@
    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
    LEFT JOIN favor f on f.reagent_id = sr.id AND f.user_id = #{user}
    where sr.valid_flag = 1
@@ -300,7 +301,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
    and (supplier.valid_flag = 1 or sr.type = 0)
    <if test="cas != null and cas != ''">
      and sr.cas like concat("%", #{cas} ,"%")
    </if>
@@ -320,7 +321,7 @@
    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
    and (ss.valid_flag = 1 or sr.type = 0)
    <if test="cas != null and cas != ''">
        and sr.cas = #{cas}
    </if>