From a61aaa65184c3b1199e72848583e9fd202eb5e7b Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期日, 03 一月 2021 00:39:14 +0800
Subject: [PATCH] 优化代码

---
 java110-db/src/main/resources/mapper/store/ResourceStoreServiceDaoImplMapper.xml |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/store/ResourceStoreServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/store/ResourceStoreServiceDaoImplMapper.xml
index 5882840..cbaff2d 100644
--- a/java110-db/src/main/resources/mapper/store/ResourceStoreServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/store/ResourceStoreServiceDaoImplMapper.xml
@@ -93,7 +93,7 @@
         from resource_store t
         where 1 =1
         <if test="resName !=null and resName != ''">
-            and t.res_name= #{resName}
+            and t.res_name like concat('%',#{resName},'%')
         </if>
         <if test="price !=null and price != ''">
             and t.price= #{price}
@@ -118,6 +118,9 @@
         </if>
         <if test="resId !=null and resId != ''">
             and t.res_id= #{resId}
+        </if>
+        <if test="resOrderType == '20000'">
+            and t.stock > 0
         </if>
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
@@ -166,7 +169,7 @@
         from resource_store t
         where 1 =1
         <if test="resName !=null and resName != ''">
-            and t.res_name= #{resName}
+            and t.res_name like concat('%',#{resName},'%')
         </if>
         <if test="price !=null and price != ''">
             and t.price= #{price}
@@ -192,6 +195,9 @@
         <if test="resId !=null and resId != ''">
             and t.res_id= #{resId}
         </if>
+        <if test="resOrderType == '20000'">
+            and t.stock > 0
+        </if>
 
 
     </select>

--
Gitblit v1.8.0