陶杰
2024-09-19 5c57ed6a4fb53d016e0d77864d0a4a8341bd4efb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package com.mzl.flower.mapper.payment;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mzl.flower.dto.request.payment.OrderQueryDTO;
import com.mzl.flower.dto.response.payment.*;
import com.mzl.flower.entity.payment.Order;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
 
import java.time.LocalDateTime;
import java.util.List;
 
@Repository
public interface OrderMapper extends BaseMapper<Order> {
    void setPartnerOrderReceive();
 
    List<Order> getPartnerOrderReceive();
 
    List<OrderStatusCountDTO> getOrderStatusCount(@Param("condition") OrderQueryDTO dto);
 
    List<OrderListDTO> selectOrderList(Page page, @Param("condition") OrderQueryDTO dto);
 
    List<OrderCheckListDTO> selectOrderCheckList(@Param("condition") OrderQueryDTO dto);
 
    List<SupplierNumDTO> getSupplierSaleNum(@Param("startTime")LocalDateTime startTime
            , @Param("endTime")LocalDateTime endTime);
 
    List<Order> getOrderForSettlement();
 
    List<Order> getOrderForAutoReceive(@Param("endTime")LocalDateTime endTime);
 
    List<Order> getOrderForBill(@Param("startTime")LocalDateTime startTime
            , @Param("endTime")LocalDateTime endTime);
 
    Order getUserLastOrder(@Param("userId") String userId);
 
    List<OrderPointGoodsListDTO> getPointGoodsList(@Param("orderId") String orderId);
 
    @Select("SELECT t1.* " +
            "FROM t_order t1 " +
            "JOIN ( " +
            "    SELECT create_by, MAX(receive_time) AS max_time " +
            "    FROM t_order " +
            "    where receive_time is not null  " +
            "    GROUP BY create_by " +
            "    HAVING max_time < NOW() - INTERVAL 30 DAY " +
            ") t2 ON t1.create_by = t2.create_by AND t1.receive_time = t2.max_time " +
            "LEFT JOIN t_customer_info c ON t1.create_by = c.user_id ")
    List<Order> getOrderInfoByReceiveTime();
 
    Integer getFlowerCompleteNumToday(@Param("userId") String userId,@Param("flowerId") Long flowerId);
}