苍穹外卖--用户端&管理端--订单管理业务操作的全部代码实现

This commit is contained in:
2025-11-25 15:51:21 +08:00
parent 0ce2d90e9a
commit 8a2a8ddb74
9 changed files with 682 additions and 9 deletions

View File

@@ -1,10 +1,9 @@
package com.sky.mapper;
import com.github.pagehelper.Page;
import com.sky.dto.OrdersPageQueryDTO;
import com.sky.entity.Orders;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.*;
import java.time.LocalDateTime;
@@ -23,4 +22,29 @@ public interface OrderMapper {
//处理支付pem问题
@Update("update orders set status = #{orderStatus},pay_status = #{orderPaidStatus},checkout_time = #{checkOutTime} where id = #{id}")
void updateStatus(Integer orderStatus, Integer orderPaidStatus, LocalDateTime checkOutTime, Long id);
@Select("select * from orders where number = #{number}")
Orders getByNumber(String number);
void update(Orders orders);
/**
* 分页条件查询并按下单时间排序
* @param ordersPageQueryDTO
*/
Page<Orders> pageQuery(OrdersPageQueryDTO ordersPageQueryDTO);
/**
* 根据id查询订单
* @param id
*/
@Select("select * from orders where id=#{id}")
Orders getById(Long id);
/**
* 根据状态统计订单数量
* @param status
*/
@Select("select count(id) from orders where status = #{status}")
Integer countStatus(Integer status);
}