Showing
4 changed files
with
7 additions
and
3 deletions
@@ -36,5 +36,5 @@ public interface SellerOrderMapper { | @@ -36,5 +36,5 @@ public interface SellerOrderMapper { | ||
36 | * @param uid | 36 | * @param uid |
37 | * @return | 37 | * @return |
38 | */ | 38 | */ |
39 | - Integer selectOrderNumByUid(@Param("uid") int uid); | 39 | + Integer selectOrderNumByUid(@Param("uid") int uid, @Param("statusList")Collection<Integer> statusList); |
40 | } | 40 | } |
@@ -219,5 +219,9 @@ | @@ -219,5 +219,9 @@ | ||
219 | 219 | ||
220 | <select id="selectOrderNumByUid" resultType="java.lang.Integer"> | 220 | <select id="selectOrderNumByUid" resultType="java.lang.Integer"> |
221 | select count(*) from seller_order where uid = #{uid,jdbcType=INTEGER} and is_del = 1 | 221 | select count(*) from seller_order where uid = #{uid,jdbcType=INTEGER} and is_del = 1 |
222 | + and status in | ||
223 | + <foreach collection="statusList" item="status" open="(" close=")" separator=","> | ||
224 | + #{status,jdbcType=INTEGER} | ||
225 | + </foreach> | ||
222 | </select> | 226 | </select> |
223 | </mapper> | 227 | </mapper> |
@@ -36,7 +36,7 @@ public enum SellerOrderListType { | @@ -36,7 +36,7 @@ public enum SellerOrderListType { | ||
36 | ), | 36 | ), |
37 | 37 | ||
38 | ORDER_SUCCESS(5, "交易完成", | 38 | ORDER_SUCCESS(5, "交易完成", |
39 | - Arrays.asList(OrderStatus.WAITING_RECEIVE.getCode()) | 39 | + Arrays.asList(OrderStatus.WAITING_RECEIVE.getCode(),OrderStatus.DONE.getCode()) |
40 | ), | 40 | ), |
41 | 41 | ||
42 | ORDER_FAILED(6, "交易失败", | 42 | ORDER_FAILED(6, "交易失败", |
@@ -504,7 +504,7 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi | @@ -504,7 +504,7 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi | ||
504 | */ | 504 | */ |
505 | public OrderSummaryResp selectOrderNumByUid(int uid) { | 505 | public OrderSummaryResp selectOrderNumByUid(int uid) { |
506 | //todo add cache | 506 | //todo add cache |
507 | - Integer num = sellerOrderMapper.selectOrderNumByUid(uid); | 507 | + Integer num = sellerOrderMapper.selectOrderNumByUid(uid, Arrays.asList(SellerOrderStatus.HAS_PAYED.getCode())); |
508 | List<SellerOrderListType> types = Arrays.asList(SellerOrderListType.WAITING_SEND, SellerOrderListType.WAITING_PAY); | 508 | List<SellerOrderListType> types = Arrays.asList(SellerOrderListType.WAITING_SEND, SellerOrderListType.WAITING_PAY); |
509 | List<Integer> statusList = types.parallelStream().flatMap(solt -> solt.getStatus().parallelStream()).collect(Collectors.toList()); | 509 | List<Integer> statusList = types.parallelStream().flatMap(solt -> solt.getStatus().parallelStream()).collect(Collectors.toList()); |
510 | Integer buyerOrderNum = buyerOrderMapper.selectCntBySellerUid(uid, statusList); | 510 | Integer buyerOrderNum = buyerOrderMapper.selectCntBySellerUid(uid, statusList); |
-
Please register or login to post a comment