package com.repair.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.repair.model.pojo.RepairRecord;
import com.repair.model.vo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author ceshi
 * @since 2023-07-24
 */
@Repository
public interface RepairRecordMapper extends BaseMapper<RepairRecord> {
    RepairRecordCountVo queryRepairRecordCount(@Param("userId") Integer userId);

    IPage<MyRepairRecordVo> queryMyRepairRecordList(IPage<MyRepairRecordVo> page, @Param("stateStr") String stateStr, @Param("userId") Integer userId);

    MaintenanceTechnicianVo queryRepairTechnicianCount(@Param("userId") Integer userId, @Param("dateNow") String dateNow, @Param("schoolId") Integer schoolId);

    IPage<RepairTechnicianVo> queryPendingOrderList(IPage<RepairTechnicianVo> page, @Param("userId") Integer userId, @Param("dateNow") String dateNow, @Param("schoolId") Integer schoolId);

    IPage<RepairTechnicianVo> queryRepairOrderList(IPage<RepairTechnicianVo> page, @Param("userId") Integer userId, @Param("dateNow") String dateNow, @Param("schoolId") Integer schoolId);

    IPage<RepairTechnicianVo> queryTimeoutOrderList(IPage<RepairTechnicianVo> page, @Param("userId") Integer userId, @Param("dateNow") String dateNow, @Param("schoolId") Integer schoolId);

    IPage<RepairTechnicianVo> queryExamineOrderList(IPage<RepairTechnicianVo> page, @Param("userId") Integer userId, @Param("schoolId") Integer schoolId);

    RepairManageCountVo queryManageCount(@Param("schoolId") Integer schoolId, @Param("keyWord") String keyWord, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("maintenanceName") String maintenanceName);

    IPage<RepairRecordPageVo> queryNotTimeout(IPage<RepairRecordPageVo> page, @Param("stateStr") String stateStr, @Param("keyWord") String keyWord, @Param("startTime") String startTime, @Param("endTime") String endTime,@Param("schoolId") Integer schoolId, @Param("maintenanceName") String maintenanceName);

    IPage<RepairRecordTimeoutPageVo> queryTimeout(IPage<RepairRecordTimeoutPageVo> page, @Param("keyWord") String keyWord, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("schoolId") Integer schoolId, @Param("maintenanceName") String maintenanceName);

    IPage<pendingOrderVo> queryPendingOrder(IPage<pendingOrderVo> page, @Param("schoolId") Integer schoolId);

    TeamWorkCountVo queryTeamWorkCount(@Param("schoolId") Integer schoolId, @Param("dateNow") String dateNow);

    IPage<RepairTechnicianVo> queryTeamWorkExamine(IPage<RepairTechnicianVo> page,@Param("schoolId") Integer schoolId);

    IPage<RepairTechnicianVo> queryTeamWorkPending(IPage<RepairTechnicianVo> page,@Param("schoolId") Integer schoolId, @Param("dateNow") String dateNow);

    IPage<RepairTechnicianVo> queryTeamWorkMaintenance(IPage<RepairTechnicianVo> page,@Param("schoolId") Integer schoolId, @Param("dateNow") String dateNow);

    IPage<RepairTechnicianVo> queryTeamWorkFinished(IPage<RepairTechnicianVo> page,@Param("schoolId") Integer schoolId);

    IPage<RepairTechnicianVo> queryTeamWorkLogistics(IPage<RepairTechnicianVo> page,@Param("schoolId") Integer schoolId);

    IPage<RepairTechnicianVo> queryTeamWorkTimeout(IPage<RepairTechnicianVo> page,@Param("schoolId") Integer schoolId, @Param("dateNow") String dateNow);

    IPage<RepairTechnicianVo> queryTeamWorkClosed(IPage<RepairTechnicianVo> page,@Param("schoolId") Integer schoolId);

    IPage<RepairTechnicianVo> queryTeamWorkOffline(IPage<RepairTechnicianVo> page,@Param("schoolId") Integer schoolId);

    List<ReportExportVo> queryNotTimeoutReportExport(String stateStr, String keyWord, String startTime, String endTime, Integer schoolId);

    List<ReportExportVo> queryTimeoutReportExport(String keyWord, String startTime, String endTime, Integer schoolId);

    MasterHomepageVo queryMasterHomeCount(@Param("userId") Integer userId, @Param("schoolId") Integer schoolId);

    MasterHomepageVo queryLogisticHomeCount(@Param("schoolId") Integer schoolId);

	List<RepairCampusRecordVo> repairCampusTotal();

    List<RepairCampusRecordVo> repairCampus(String startTime, String endTime);

    IPage<RepairAreaVo> repairAreaTotal(IPage<RepairAreaVo> page);

    IPage<RepairAreaVo> repairArea(IPage<RepairAreaVo> page,String startTime, String endTime);

    IPage<MaintenanceGoodsVo> maintenanceGoodsTotal(IPage<MaintenanceGoodsVo> page);

    IPage<MaintenanceGoodsVo> maintenanceGoods(IPage<MaintenanceGoodsVo> page,String startTime, String endTime);

    List<RepairAreaVo> repairAreaExport(String startTime, String endTime);

    List<MaintenanceGoodsVo>  maintenanceGoodsExport(String startTime, String endTime);

    DetailsVo queryDetailData(@Param("recordId") Integer recordId);

    RepairAnalysisVo repairAnalysis(@Param("startTime")String startTime,@Param("endTime") String endTime);

    Integer queryTimeOut(@Param("startTime")String startTime,@Param("endTime") String endTime);

    RepairSummarizingVo repairSummarizing(@Param("startTime")String startTime,@Param("endTime") String endTime);

    RepairTotalDataVo repairTotalData();

    PrintVo queryPrintData(@Param("recordId") Integer recordId);
}
