苍穹外卖--订单状态自动更新:超时未支付&派送中修改为已完成

This commit is contained in:
2025-12-01 11:33:56 +08:00
parent 8a2a8ddb74
commit 2c2b7b86a5
4 changed files with 94 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ import com.sky.entity.Orders;
import org.apache.ibatis.annotations.*;
import java.time.LocalDateTime;
import java.util.List;
@Mapper
public interface OrderMapper {
@@ -47,4 +48,13 @@ public interface OrderMapper {
*/
@Select("select count(id) from orders where status = #{status}")
Integer countStatus(Integer status);
/**
* 根据支付状态和时间获取订单的查询操作
* @param status
* @param time
* @return
*/
@Select("select * from orders where status = #{status} and order_time < #{time}")
List<Orders> getByStatusAndOrderTime(Integer status, LocalDateTime time);
}