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


import cn.com.ty.lift.business.maintenance.dao.entity.model.response.MaintenancePlanPrintResponse;
import cn.com.ty.lift.business.project.dao.entity.Project;
import cn.com.ty.lift.business.project.dao.entity.model.request.*;
import cn.com.ty.lift.business.project.dao.entity.model.response.*;
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/12/09
 * @description 项目数据层
 */
public interface ProjectMapper extends BaseMapper<Project> {

    IPage<ProjectResponse> findByCondition(IPage<ProjectResponse> page, @Param("request") ProjectRequest request);

    IPage<ProjectResponse> findCompanyListByCondition(IPage<ProjectResponse> page, @Param("request") ProjectRequest request);

    /**
     * @param request 项目id
     * @return IPage<ProjectLiftResponse> 项目电梯分页列表
     * @description app端 根据项目id查询项目电梯列表
     * @date 2019/12/31 4:23 PM
     */
    IPage<ProjectLiftResponse> findListByProjectId(IPage<ProjectLiftResponse> page, @Param("request") ProjectRequest request);


    /**
     * @param request 公司id
     * @return IPage<ProjectCompanyResponse> 公司项目分页列表
     * @description app端 根据公司id查询公司项目列表
     * @date 2019/12/31 4:23 PM
     */
    IPage<ProjectCompanyResponse> findListByCompanyId(IPage<ProjectCompanyResponse> page, @Param("request") ProjectRequest request);

    /**
     * @param projectId 项目id
     * @return ProjectDetailResponse 项目详情
     * @description 根据项目id查询项目详情
     * @date 2020/1/2 10:52 上午
     */
    ProjectDetailResponse findProjectById(@Param("id") Long projectId);

    /**
     * @param projectIdList 项目id列表
     * @return 项目列表
     * @description 根据项目id列表查询项目列表
     * @date 2020/2/13 4:28 下午
     */
    List<MaintenancePlanPrintResponse> queryProjectListByIdList(@Param("list") List<Long> projectIdList);

    /**
     * @param request 项目id
     * @return MaintenancePlanPrintResponse 项目详情
     * @description 根据项目id查询项目详情
     * @date 2020/3/2 4:48 下午
     */
    MaintenancePlanPrintResponse findProjectByIdAndCompanyId(@Param("request") ProjectRequest request);

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

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

}