package com.zioinfo.mes.inspection.mapper;

import com.zioinfo.mes.inspection.MesInspection;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

@Mapper
public interface InspectionMapper {
    List<MesInspection> findAll(@Param("inspectionType") String inspectionType,
                                @Param("result") String result,
                                @Param("itemCode") String itemCode);
    MesInspection findById(@Param("id") Long id);
    int countByNo(@Param("inspectionNo") String inspectionNo);
    int insert(MesInspection i);
    int updateResult(@Param("id") Long id, @Param("result") String result,
                     @Param("measurements") String measurements, @Param("defectQty") Double defectQty);
    /** 검사 합격률 요약(유형별). */
    List<Map<String, Object>> passRateByType(@Param("days") int days);
}
