package com.zm.order.tool.server.dao;


import com.zm.order.tool.server.model.OrderItemBatching;
import com.zm.order.tool.server.query.ItemBatchingQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * 
 * @author NianChang
 */
@Repository
public interface OrderItemBatchingDao {

    /**
     * 新增一条记录
     *
     * @param record
     * @return 影响行数
     */
    int insert(OrderItemBatching record);

    /**
     * 批量新增
     *
     * @param list
     * @return 影响行数
     */
    int insertList(List<OrderItemBatching> list);

    int inserts(List<OrderItemBatching> list);

    OrderItemBatching selectById(@Param("id") Long id, @Param("userId") Long userId);

    int updateUpdatedAt(@Param("id") Long id, @Param("userId") Long userId);
    /**
     * 查询列表
     * @param query
     * @return:
     * @Date: 2021/3/22 2:02 下午
     */
    List<OrderItemBatching> selectList(ItemBatchingQuery query);

    List<OrderItemBatching> selectByOrderNo(@Param("orderNo") String orderNo, @Param("userId") Long userId);

    int deleteByOrderNo(@Param("orderNo") String orderNo, @Param("userId") Long userId);

    /**
     * 删除加料
     */
    int deletes(@Param("idList") List<Long> idList,
                @Param("userId") Long userId,
                @Param("deleteType") Integer deleteType);

    int updateSellerUser(
            @Param("sellerId") Long sellerId,
            @Param("storeId") Long storeId,
            @Param("oldUserId") Long oldUserId,
            @Param("newUserId") Long newUserId,
            @Param("orderNo") String orderNo);
}
