package com.ym.mec.biz.dal.dao;

import com.ym.mec.biz.dal.dto.CheckItemDto;
import com.ym.mec.biz.dal.entity.CourseSchedule;
import com.ym.mec.biz.dal.entity.InspectionItemPlanConclusion;
import com.ym.mec.common.dal.BaseDAO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface InspectionItemPlanConclusionDao extends BaseDAO<Long, InspectionItemPlanConclusion> {

    /**
     * 插入巡查结果
     *
     * @param inspectionItemPlanConclusions
     * @return
     */
    int batchAdd(@Param("inspectionItemPlanConclusions") List<InspectionItemPlanConclusion> inspectionItemPlanConclusions);

    /**
     * 根据日程计划id和检查事项id删除检查结果
     *
     * @param planId
     * @param checkItem
     * @return
     */
    int delByPlanIdAndCheckItem(@Param("planId") Long planId, @Param("checkItem") Integer checkItem);

    /**
     * 获取巡查日程提交的最后结果项
     *
     * @param planIds
     * @return
     */
    List<CheckItemDto> getLastCheckItem(@Param("planIds") List<Long> planIds);

    /**
     * 获取巡查日程的巡查结果
     *
     * @param planId
     * @param checkItem
     * @return
     */
    List<InspectionItemPlanConclusion> getInspectionItemPlanConclusion(@Param("planId") Long planId, @Param("checkItem") Integer checkItem);

    /**
     * 获取巡查结果的课程信息
     *
     * @return
     */
    List<CourseSchedule> getPlanConclusionCourses(@Param("planId") Long planId);

    /**
     * 获取日程检查结果的数量
     *
     * @param planId
     * @param checkConclusion
     * @return
     */
    int getCountByPlanIdAndCheckConclusion(@Param("planId") Long planId, @Param("checkConclusion") Integer checkConclusion);
}