From 83e82c1e516948ee22c7b763e316a4d952b48d9c Mon Sep 17 00:00:00 2001
From: gdg <764716047@qq.com>
Date: 星期一, 07 十二月 2020 14:51:57 +0800
Subject: [PATCH] 模糊查询

---
 src/main/java/com/nanometer/smartlab/dao/SysReagentDao.xml |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/nanometer/smartlab/dao/SysReagentDao.xml b/src/main/java/com/nanometer/smartlab/dao/SysReagentDao.xml
index f067e14..bff07b9 100644
--- a/src/main/java/com/nanometer/smartlab/dao/SysReagentDao.xml
+++ b/src/main/java/com/nanometer/smartlab/dao/SysReagentDao.xml
@@ -139,7 +139,7 @@
       </otherwise>
     </choose>
     <if test="cas != null and cas != ''">
-      and sr.cas = #{cas}
+      and sr.cas like concat("%",#{cas},"%")
     </if>
     <if test="supplierId != null and supplierId != ''">
       and sr.supplier_id = #{supplierId}
@@ -148,7 +148,7 @@
       and sr.name like concat("%", #{name} ,"%")
     </if>
     <if test="productSn != null and productSn != ''">
-      and sr.product_sn = #{productSn}
+      and sr.product_sn like concat("%",#{productSn},"%")
     </if>
     <choose>
       <when test="favorFlag != ''">
@@ -180,7 +180,7 @@
       </otherwise>
     </choose>
     <if test="cas != null and cas != ''">
-      and sr.cas = #{cas}
+      and sr.cas like  concat("%",#{cas},"%")
     </if>
     <if test="supplierId != null and supplierId != ''">
       and sr.supplier_id = #{supplierId}
@@ -189,7 +189,7 @@
       and sr.name like concat("%", #{name} ,"%")
     </if>
     <if test="productSn != null and productSn != ''">
-      and sr.product_sn = #{productSn}
+      and sr.product_sn like concat("%",#{productSn},"%")
     </if>
   </select>
 

--
Gitblit v1.9.2