package com.zioinfo.mall.order.mapper;

import com.zioinfo.mall.order.MallOrder;
import com.zioinfo.mall.order.MallOrderItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OrderMapper {
    List<MallOrder> findByOwner(@Param("owner") String owner, @Param("status") String status);
    List<MallOrder> findAll(@Param("status") String status, @Param("limit") int limit);
    List<MallOrder> findByStore(@Param("storeId") Long storeId, @Param("status") String status, @Param("limit") int limit);
    MallOrder findById(@Param("id") Long id);
    MallOrder findByOrderNo(@Param("orderNo") String orderNo);
    int insert(MallOrder o);
    int updateStatus(@Param("id") Long id, @Param("status") String status);
    int setProofPhoto(@Param("id") Long id, @Param("url") String url);
    int setPodPhoto(@Param("id") Long id, @Param("url") String url);

    List<MallOrderItem> findItems(@Param("orderId") Long orderId);
    int insertItem(MallOrderItem item);
}
