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

import cn.com.ty.lift.business.capital.dao.entity.CapitalRepairLiftRelevance;
import cn.com.ty.lift.business.capital.dao.entity.model.request.CapitalRepairRequest;
import cn.com.ty.lift.business.common.CommonRequest;
import cn.com.ty.lift.business.maintenance.dao.entity.model.CapitalCount;
import cn.com.ty.lift.business.project.dao.entity.model.response.ProjectCompanyResponse;
import cn.com.ty.lift.business.project.dao.entity.model.response.ProjectDetailResponse;
import cn.com.ty.lift.business.project.dao.entity.model.response.ProjectLiftResponse;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;

/**
 * @author bieao
 * @date 2020/4/15
 * @description 大修电梯数据层
 */
public interface CapitalRepairLiftRelevanceMapper extends BaseMapper<CapitalRepairLiftRelevance> {

    /**
     * @param request 大修项目id
     * @return RestResponse 电梯列表
     * @description 根据大修项目id查询项目下电梯列表
     * @date 2020/4/15 4:15 下午
     */
    IPage<ProjectLiftResponse> findListByProjectId(IPage<ProjectLiftResponse> page, @Param("request") CapitalRepairRequest request);

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

    /**
     * @param request 项目id
     * @return ProjectDetailResponse 项目详情
     * @description 根据项目id查询项目详情
     * @date 2020/4/21 9:13 下午
     */
    ProjectDetailResponse findProjectById(@Param("request") CapitalRepairRequest request);

    int count(@Param("mtCompanyId") Long mtCompanyId, @Param("projectStatus") String projectStatus);

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

    CapitalCount countCapitalByUserId(@Param("request") CapitalRepairRequest request);

}
