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

import cn.com.ty.lift.business.maintenance.dao.entity.model.dto.MaintenancePlanMonthTaskNum;
import cn.com.ty.lift.business.maintenance.dao.entity.model.response.*;
import cn.com.ty.lift.common.constants.SqlConstants;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

public interface PropertyMapper {
    @Select(SqlConstants.QUERY_MAINTENANCE_PLAN_EVERYDAY)
    IPage<PropertyMtResponse> queryMaintenancePlanEveryDay(IPage<PropertyMtResponse> page, Integer status, LocalDate planDate, Long userId);

    @Select(SqlConstants.QUERY_MAINTENANCE_PLAN_EVERYDAY_OVERDUE)
    IPage<PropertyMtResponse> queryMaintenancePlanEveryDayOverdue(IPage<PropertyMtResponse> page, LocalDate planDate, Long userId);

    @Select(SqlConstants.QUERY_MAINTENANCE_PLAN_MONTH_TASK_NUM)
    List<MaintenancePlanMonthTaskNum> queryMaintenancePlanMonth(Long userId, String yearMonth);

    @Select(SqlConstants.QUERY_EMERGENCY_REPAIR_DYNAMIC_MESSAGE)
    IPage<DynamicMessageResponse> queryEmergencyRepairDynamicMessage(IPage<DynamicMessageResponse> page, Long userId);

    @Select(SqlConstants.QUERY_MAINTENANCE_SUCCESS_DYNAMIC_MESSAGE)
    IPage<DynamicMessageResponse> queryMaintenanceSuccessDynamicMessage(IPage<DynamicMessageResponse> page, Long userId);

    @Select(SqlConstants.QUERY_JOIN_PROJECT_LIST)
    List<PropertyProjectListResponse> queryJoinProjectList(Long userId);

    @Select(SqlConstants.QUERY_EVALUATE_AUTH)
    List<PropertyEvaluateAuthResponse> queryEvaluateAuth(String table, Long userId);

    @Select(SqlConstants.QUERY_REPAIR_LIST)
    IPage<RepairResponse> queryRepairList(IPage<RepairResponse> page, Integer status, Long userId);

    @Select({SqlConstants.QUERY_MAINTENANCE_COUNT_BY_USER_ID})
    int queryMaintenanceCountByUserId(Long userId);

    @Select({SqlConstants.QUERY_REPAIR_COUNT_BY_USER_ID})
    int queryRepairCountByUserId(Long userId);
}