zangbin 3 лет назад
Родитель
Сommit
aa6d639c60

+ 9 - 0
lb-module/src/main/java/com/ydd/module/service/impl/OrderServiceImpl.java

@@ -361,6 +361,15 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             }
             order.setPersonnelIds(personnelIds);
         }
+        // 新增订单门店查询按钮
+        if (StringUtils.isNotEmpty(order.getShopName())) {
+          Shop shop = iShopService.getOne(new QueryWrapper<Shop>().eq("deleted", 0)
+            .eq("status", 1).eq("name", order.getShopName()));
+
+          if (shop != null) {
+            order.setShopId(shop.getId());
+          }
+        }
         return result;
     }
 

+ 4 - 4
lb-module/src/main/resources/mapper/module/orderMapper.xml

@@ -1000,8 +1000,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="params.paymentType != null">
             AND (o.payment_type = #{params.paymentType} and o.status != 0)
         </if>
-        <if test="params.shopName != null and params.shopName != ''">
-            AND o.shop_name like concat('%', #{params.shopName}, '%')
+        <if test="params.shopId != null">
+            AND o.shop_id = #{params.shopId}
         </if>
     </select>
 
@@ -1186,8 +1186,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="params.paymentType != null">
             AND (o.payment_type = #{params.paymentType} and o.status != 0)
         </if>
-        <if test="params.shopName != null and params.shopName != ''">
-            AND o.shop_name like concat('%', #{params.shopName}, '%')
+        <if test="params.shopId != null">
+            AND o.shop_id = #{params.shopId}
         </if>
         ORDER BY o.create_time DESC
     </select>