package cn.com.ty.lift.business.emergency.mapper;

import cn.com.ty.lift.business.common.CommonRequest;
import cn.com.ty.lift.business.emergency.dto.EmergencyCount;
import cn.com.ty.lift.business.emergency.dto.RepairRequest;
import cn.com.ty.lift.business.emergency.dto.RepairResponse;
import cn.com.ty.lift.business.emergency.entity.EmergencyRepair;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *      临修记录 Mapper 接口
 * </p>
 *
 * @author wcz
 * @since 2019-12-04
 */
public interface EmergencyRepairMapper extends BaseMapper<EmergencyRepair> {

    IPage<RepairResponse> pageByRepairing(IPage<RepairResponse> page, @Param("cond") RepairRequest request);

    IPage<RepairResponse> pageByCondition(IPage<RepairResponse> page, @Param("cond") RepairRequest request);

    long countByCondition(@Param("cond") RepairRequest request);

    RepairResponse infoById(@Param("id") Long id);

    IPage<RepairResponse> pageByUser(IPage<RepairResponse> page, @Param("cond") RepairRequest request);

    IPage<RepairResponse> pageByLift(IPage<RepairResponse> page, @Param("cond") RepairRequest request);

    List<RepairResponse> listByIdList(@Param("cond") RepairRequest request);

    long countDoingByUser(@Param("cond") CommonRequest request);

    EmergencyCount countEmergencyByUserId(@Param("request") RepairRequest request);
}
