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

import com.ym.mec.biz.dal.entity.InspectionItem;
import com.ym.mec.common.dal.BaseDAO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface InspectionItemDao extends BaseDAO<Long, InspectionItem> {

    /**
     * 获取任务项数目及总次数
     *
     * @param inspectionIds
     * @return
     */
    List<InspectionItem> getItemCountAndTimes(@Param("inspectionIds") List<Long> inspectionIds);

    /**
     * 批量插入巡查任务表
     *
     * @param inspectionItems
     * @return
     */
    int batchInsert(@Param("inspectionItems") List<InspectionItem> inspectionItems);


    /**
     * 获取巡查任务的任务事项
     *
     * @param inspectionId
     * @return
     */
    List<InspectionItem> getItemByInspectionId(@Param("inspectionId") Long inspectionId);

    /**
     * 根据id删除任务事项
     *
     * @param ids
     * @return
     */
    int deleteByIds(@Param("ids") List<Long> ids);

    /**
     * 批量更新巡查任务事项
     *
     * @param inspectionItems
     * @return
     */
    int batchUpdate(@Param("inspectionItems") List<InspectionItem> inspectionItems);

    /**
     * 根据任务项删除任务事项
     *
     * @param InspectionId
     * @return
     */
    int deleteByInspectionId(@Param("InspectionId") Long InspectionId);
}