package com.cool.store.mapper;

import com.cool.store.entity.plan.ShopDeliveryPlanItemDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ShopDeliveryPlanItemMapper {

    /**
     * 根据ID查询
     */
    ShopDeliveryPlanItemDO getById(@Param("id") Long id);

    /**
     * 根据主表ID查询明细列表
     */
    List<ShopDeliveryPlanItemDO> listByPlanId(@Param("planId") Long planId);

    /**
     * 根据主表ID和类型查询明细
     */
    ShopDeliveryPlanItemDO getByPlanIdAndItemType(@Param("planId") Long planId, @Param("itemType") Integer itemType);

    /**
     * 插入
     */
    int insert(ShopDeliveryPlanItemDO record);

    /**
     * 批 liqu量插入
     */
    int batchInsert(@Param("list") List<ShopDeliveryPlanItemDO> list);

    /**
     * 更新
     */
    int update(ShopDeliveryPlanItemDO record);

    /**
     * 删除
     */
    int deleteById(@Param("id") Long id);

    /**
     * 根据主表ID删除明细
     */
    int deleteByPlanId(@Param("planId") Long planId);
}