wangming 23 цаг өмнө
parent
commit
bf4df2e59c

+ 2 - 0
yami-shop-service/src/main/java/com/yami/shop/dao/OrderMapper.java

@@ -44,6 +44,8 @@ public interface OrderMapper extends BaseMapper<Order> {
 
     List<Order> deliverList(@Param("adapter") PageAdapter adapter, @Param("orderParam") BackendOrderParam orderParam);
 
+    Integer deliverListCount(@Param("orderParam") BackendOrderParam orderParam);
+
     Long countOrderDetial(@Param("orderParam") OrderParam orderParam);
 
     UserShoppingDataDto calculateUserInShopData(@Param("shopId") Long shopId, @Param("userId") String userId);

+ 1 - 1
yami-shop-service/src/main/java/com/yami/shop/service/impl/OrderServiceImpl.java

@@ -349,7 +349,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             });
         }
         page.setRecords(orderList);
-        page.setTotal(orderList.size());
+        page.setTotal(orderMapper.deliverListCount(orderParam));
         return page;
     }
 

+ 54 - 0
yami-shop-service/src/main/resources/mapper/OrderMapper.xml

@@ -513,6 +513,60 @@
         LIMIT #{adapter.begin} , #{adapter.size}
     </select>
 
+    <select id="deliverListCount" resultType="integer">
+        SELECT count(1) FROM tz_order a
+        LEFT JOIN tz_user_addr_order b on a.addr_order_id=b.addr_order_id
+        LEFT JOIN tz_shop_detail c on a.shop_id=c.shop_id
+        <where>
+            a.dvy_type=3
+            <if test="orderParam.orderNumber != null and orderParam.orderNumber != ''">
+                and a.order_number = #{orderParam.orderNumber}
+            </if>
+            <if test="orderParam.shopId != null">
+                and a.shop_id = #{orderParam.shopId}
+            </if>
+            <if test="orderParam.startTime != null">
+                and a.create_time &gt; #{orderParam.startTime}
+            </if>
+            <if test="orderParam.endTime != null">
+                and a.create_time &lt; #{orderParam.endTime}
+            </if>
+            <if test="orderParam.refundStatus != null and orderParam.refundStatus != 0">
+                and a.refund_status = #{orderParam.refundStatus}
+            </if>
+            <if test="orderParam.receiver != null">
+                and b.receiver LIKE concat("%",#{orderParam.receiver},"%")
+            </if>
+            <if test="orderParam.mobile != null">
+                and b.mobile LIKE concat("%",#{orderParam.mobile},"%")
+            </if>
+
+            <if test="orderParam.orderStatus != null and orderParam.orderStatus != ''">
+                <if test="orderParam.orderStatus == 'all'">
+                    AND a.hb_order_status in (0, 1,20,30,40,50,60,70,80)
+                </if>
+                <if test="orderParam.orderStatus == 'paddingPay'">
+                    AND a.hb_order_status in (0)
+                </if>
+
+                <if test="orderParam.orderStatus == 'paddingShipped'">
+                    AND a.hb_order_status in (1)
+                </if>
+
+                <if test="orderParam.orderStatus == 'paddingReceived'">
+                    AND a.hb_order_status in (20,30,40,50,70)
+                </if>
+                <if test="orderParam.orderStatus == 'completed'">
+                    AND a.hb_order_status in (80)
+                </if>
+                <if test="orderParam.orderStatus == 'cancel'">
+                    AND a.hb_order_status in (60)
+                </if>
+            </if>
+        </where>
+    </select>
+
+
 
     <select id="countOrderDetial" resultType="long">
         SELECT count(0)