package com.zioinfo.mall.cart.mapper;

import com.zioinfo.mall.cart.MallCartItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CartMapper {
    List<MallCartItem> findByOwner(@Param("owner") String owner);
    MallCartItem findExisting(@Param("owner") String owner, @Param("productId") Long productId, @Param("optionId") Long optionId);
    MallCartItem findById(@Param("id") Long id);
    int insert(MallCartItem item);
    int updateQty(@Param("id") Long id, @Param("owner") String owner, @Param("quantity") int quantity);
    int delete(@Param("id") Long id, @Param("owner") String owner);
    int clear(@Param("owner") String owner);
}
