package cn.com.ty.lift.business.library.dao.mapper;

import cn.com.ty.lift.business.annualinspection.dto.InspectionRequest;
import cn.com.ty.lift.business.library.dao.entity.Lift;
import cn.com.ty.lift.business.library.dao.entity.model.LiftProjectModel;
import cn.com.ty.lift.business.library.dao.entity.model.request.LiftRequest;
import cn.com.ty.lift.business.library.dao.entity.model.response.LiftAnnualInspectionResponse;
import cn.com.ty.lift.business.library.dao.entity.model.response.LiftExtendResponse;
import cn.com.ty.lift.business.library.dao.entity.model.response.LiftResponse;
import cn.com.ty.lift.business.maintenance.dao.entity.model.response.LiftPrintResponse;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;

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


/**
 * @author bieao
 * @date 2019/11/27
 * @description 电梯档案数据层
 */
public interface LiftMapper extends BaseMapper<Lift> {

    IPage<LiftResponse> findByCondition(IPage<LiftResponse> page, @Param("request") LiftRequest request);

    IPage<LiftResponse> findLiftListByProjectId(IPage<LiftResponse> page, @Param("request") LiftRequest request);

    List<LiftProjectModel> listByCompanyAndProject(@Param("mtCompanyId") Long mtCompanyId, @Param("projectId") Long projectId);

    IPage<LiftResponse> chooseLiftList(IPage<LiftResponse> page, @Param("request") LiftRequest request);

    LiftExtendResponse queryById(@Param("id") Long id, @Param("projectId") Long projectId);

    /**
     * @param liftIdList 电梯id列表
     * @return 电梯列表
     * @description 根据电梯id列表查询电梯列表
     * @date 2020/2/13 4:28 下午
     */
    List<LiftPrintResponse> queryLiftListByIdList(@Param("list") List<Long> liftIdList);

    /**
     * 查询待确认的年检信息
     */
    IPage<LiftAnnualInspectionResponse> toConfirmAnnualInspection(IPage<LiftAnnualInspectionResponse> page, @Param("request") InspectionRequest request);

    List<Lift> groupByRegistrationCode();

    List<Map<String, String>> exportList(@Param("exportList") List<String> ids);
}