cloudroam
2024-09-03 e32fe26a1945fb44100d06b7049ccce865b11d4a
src/main/java/com/mzl/flower/mapper/payment/OrderMapper.java
@@ -3,12 +3,10 @@
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.OrderCheckListDTO;
import com.mzl.flower.dto.response.payment.OrderListDTO;
import com.mzl.flower.dto.response.payment.OrderStatusCountDTO;
import com.mzl.flower.dto.response.payment.SupplierNumDTO;
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;
@@ -36,4 +34,18 @@
    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  and DATE(receive_time) < DATE(NOW()) - INTERVAL 30 DAY" +
            "    GROUP BY create_by " +
            ") 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();
}