ソースを参照

like查询修改

于俊龙 2 週間 前
コミット
10d6f00964

+ 8 - 8
farm-sankin-biz/src/main/resources/mapper/BssOrderMapper.xml

@@ -51,7 +51,7 @@
                 and bo.status = #{status}
             </if>
             <if test="itemName != null  and itemName != ''">
-                and bodi.item_name like '%' || #{itemName} || '%'
+                and bodi.item_name like concat('%', #{itemName} , '%')
             </if>
             <if test="orderDate != null">
                 <if test="orderDate.startDate != null  and orderDate.startDate != ''">
@@ -64,10 +64,10 @@
                 </if>
             </if>
             <if test="customerName != null  and customerName != ''">
-                and bo.customer_name like '%' || #{customerName} || '%'
+                and bo.customer_name like concat('%', #{customerName} , '%')
             </if>
             <if test="deliveryCustomerName != null  and deliveryCustomerName != ''">
-                and bod.delivery_customer_name like '%' || #{deliveryCustomerName} || '%'
+                and bod.delivery_customer_name like concat('%', #{deliveryCustomerName} , '%')
             </if>
             <if test="deliveryPlanDate != null">
                 <if test="deliveryPlanDate.startDate != null  and deliveryPlanDate.startDate != ''">
@@ -81,7 +81,7 @@
             </if>
 
             <if test="deliveryTrackingNo != null  and deliveryTrackingNo != ''">
-                and bod.delivery_tracking_no like '%' || #{deliveryTrackingNo} || '%'
+                and bod.delivery_tracking_no like concat('%', #{deliveryTrackingNo} , '%')
             </if>
 
         </where>
@@ -139,7 +139,7 @@
                 and bo.status = #{status}
             </if>
             <if test="itemName != null  and itemName != ''">
-                and bodi.item_name like '%' || #{itemName} || '%'
+                and bodi.item_name like concat('%', #{itemName} , '%')
             </if>
             <if test="orderDate != null">
                 <if test="orderDate.startDate != null  and orderDate.startDate != ''">
@@ -152,10 +152,10 @@
                 </if>
             </if>
             <if test="customerName != null  and customerName != ''">
-                and bo.customer_name like '%' || #{customerName} || '%'
+                and bo.customer_name like concat('%', #{customerName} , '%')
             </if>
             <if test="deliveryCustomerName != null  and deliveryCustomerName != ''">
-                and bod.delivery_customer_name like '%' || #{deliveryCustomerName} || '%'
+                and bod.delivery_customer_name like concat('%', #{deliveryCustomerName} , '%')
             </if>
             <if test="deliveryPlanDate != null">
                 <if test="deliveryPlanDate.startDate != null  and deliveryPlanDate.startDate != ''">
@@ -169,7 +169,7 @@
             </if>
 
             <if test="deliveryTrackingNo != null  and deliveryTrackingNo != ''">
-                and bod.delivery_tracking_no like '%' || #{deliveryTrackingNo} || '%'
+                and bod.delivery_tracking_no like concat('%', #{deliveryTrackingNo} , '%')
             </if>
 
         </where>

+ 3 - 3
farm-sankin-biz/src/main/resources/mapper/MastCustomerMapper.xml

@@ -34,13 +34,13 @@
             farmer_id = #{farmerId}
             AND discontinued_flg = '0'
             <if test="customerId != null  and customerId != ''">
-                and customer_id like '%' || #{customerId} || '%'
+                and customer_id like concat('%', #{customerId} , '%')
             </if>
             <if test="customerName != null  and customerName != ''">
-                and customer_name like '%' || #{customerName} || '%'
+                and customer_name like concat('%', #{customerName} , '%')
             </if>
             <if test="postalCode != null  and postalCode != ''">
-                and postal_code like '%' || #{postalCode} || '%'
+                and postal_code like concat('%', #{postalCode} , '%')
             </if>
             <if test="phoneNumber != null  and phoneNumber != ''">
                 and phone_number = #{phoneNumber}

+ 4 - 4
farm-sankin-biz/src/main/resources/mapper/MastItemMapper.xml

@@ -71,16 +71,16 @@
                 and item_id = #{itemId}
             </if>
             <if test="itemCode != null  and itemCode != ''">
-                and item_code like '%' || #{itemCode} || '%'
+                and item_code like concat('%', #{itemCode} , '%')
             </if>
             <if test="itemName != null  and itemName != ''">
-                and item_name like '%' || #{itemName} || '%'
+                and item_name like concat('%', #{itemName} , '%')
             </if>
             <if test="janCode != null  and janCode != ''">
-                and jan_code like '%' || #{janCode} || '%'
+                and jan_code like concat('%', #{janCode} , '%')
             </if>
             <if test="sumarejiItemId != null  and sumarejiItemId != ''">
-                and sumareji_item_id like '%' || #{sumarejiItemId} || '%'
+                and sumareji_item_id like concat('%', #{sumarejiItemId} , '%')
             </if>
             <if test="sysItemCode != null  and sysItemCode != ''">
                 and sys_item_code = #{sysItemCode}