package com.zioinfo.mes.shipping.mapper;

import com.zioinfo.mes.shipping.MesShipping;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface ShippingMapper {
    List<MesShipping> findAll(@Param("status") String status,
                              @Param("partnerCode") String partnerCode,
                              @Param("keyword") String keyword);
    MesShipping findById(@Param("id") Long id);
    int countByNo(@Param("shippingNo") String shippingNo);
    int insert(MesShipping s);
    int update(MesShipping s);
    int updateStatus(@Param("id") Long id, @Param("status") String status);
    int updatePicked(@Param("id") Long id, @Param("pickedQty") Double pickedQty);
    int updatePacked(@Param("id") Long id, @Param("packedQty") Double packedQty);
    int updateInspection(@Param("id") Long id, @Param("inspectionResult") String inspectionResult);
    int updateShip(@Param("id") Long id, @Param("shippedQty") Double shippedQty,
                   @Param("deliveryNo") String deliveryNo, @Param("statementNo") String statementNo);
    int delete(@Param("id") Long id);

    /** 상태별 카운트(대시보드). */
    List<Map<String, Object>> countByStatus();
}
