package com.tuoheng.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.entity.InspectionFile;
import com.tuoheng.admin.entity.InspectionFileDistribution;
import com.tuoheng.admin.entity.InspectionFileExtend;
import com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest;
import com.tuoheng.admin.request.inspectionfile.QueryInspectionFileDistributionListRequest;
import com.tuoheng.admin.request.inspectionfile.QueryInspectionFilePageListByInspectionIdRequest;
import com.tuoheng.admin.request.inspectionfile.QueryInspectionFilePageListRequest;
import org.apache.ibatis.annotations.Param;

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

/**
 * 巡检问题Mapper接口
 *
 * @team tuoheng
 * @author wanjing
 * @date 2022-11-23
 */
public interface InspectionFileMapper extends BaseMapper<InspectionFile> {

    int addBatch(@Param("list") List<InspectionFile> records);

    /**
     *
     * 逻辑删除巡检任务问题
     *
     * @param map
     * @return
     */
    int deleteLogicByMap(Map<String, Object> map);

    /**
     *
     * 物理删除巡检任务问题
     *
     * @param inspectionId
     * @return
     */
    int deleteByInspectionId(String inspectionId);

    int updateByIdList(Map<String, Object> map);

    List<InspectionFile> selectListByInspectIdList(List<String> inspectionIdList);

    /**
     * 查询任务ID查询任务问题分页列表
     *
     * @param request 巡检任务查询实体
     * @return 巡检任务集合
     */
    Page<InspectionFile> selectPageListByInspectionId(@Param("page") IPage page, @Param("request") QueryInspectionFilePageListByInspectionIdRequest request);

    /**
     * 查询任务问题分页列表
     *
     * @param request 巡检任务查询实体
     * @return 巡检任务集合
     */
    Page<InspectionFileExtend> selectPageList(@Param("page") IPage page, @Param("request") QueryInspectionFilePageListRequest request);

    /**
     * 查询任务问题分布列表
     *
     * @param request 巡检任务查询实体
     * @return 巡检任务集合
     */
    List<InspectionFileDistribution> selectDistributionList(@Param("request") QueryInspectionFileDistributionListRequest request);
}
