Просмотр исходного кода

将like 改为 concat的方式

wuxw лет назад: 7
Родитель
Сommit
1f0ff49b6a

+ 4 - 4
java110-db/src/main/resources/mapper/service/ServiceServiceDaoImplMapper.xml

@@ -157,7 +157,7 @@
             and t.url= #{url}
         </if>
         <if test="serviceUrl !=null and serviceUrl != ''">
-            and t.url like '%#{serviceUrl}%'
+            and t.url like concat('%',#{serviceUrl},'%')
         </if>
         <if test="timeout !=null and timeout != ''">
             and t.timeout= #{timeout}
@@ -169,7 +169,7 @@
             and t.name= #{name}
         </if>
         <if test="serviceName !=null and serviceName != ''">
-            and t.name like '%#{serviceName}%'
+            and t.name like concat('%',#{serviceName},'%')
         </if>
         <if test="serviceId !=null and serviceId != ''">
             and t.service_id= #{serviceId}
@@ -270,7 +270,7 @@
             and t.url= #{url}
         </if>
         <if test="serviceUrl !=null and serviceUrl != ''">
-            and t.url like '%#{serviceUrl}%'
+            and t.url like concat('%',#{serviceUrl},'%')
         </if>
         <if test="timeout !=null and timeout != ''">
             and t.timeout= #{timeout}
@@ -282,7 +282,7 @@
             and t.name= #{name}
         </if>
         <if test="serviceName !=null and serviceName != ''">
-            and t.name like '%#{serviceName}%'
+            and t.name like concat('%',#{serviceName},'%')
         </if>
         <if test="serviceId !=null and serviceId != ''">
             and t.service_id= #{serviceId}