package com.zksy.base.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zksy.base.domain.EquipmentBase;
import com.zksy.base.domain.vo.EquipmentFullVO;
import com.zksy.manhole.dto.in.EquipmentCountByTypeInDTO;
import com.zksy.manhole.dto.in.EquipmentExportInDTO;
import com.zksy.manhole.dto.in.ManholeDeviceListInDTO;
import com.zksy.manhole.dto.in.ManholeDevicePageInDTO;
import com.zksy.manhole.dto.out.EquipmentBaseOutDTO;
import com.zksy.manhole.dto.out.EquipmentCountByTypeOutDTO;
import com.zksy.manhole.dto.out.EquipmentExportOutDTO;

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

public interface EquipmentBaseService extends IService<EquipmentBase> {

    Page<EquipmentFullVO> findFullByPage(long pageNum, long pageSize,
                                         String equipmentCode, String equipmentName,
                                         String equipmentModel, String manufacturer,
                                         String equipmentTypeId);

    Page<EquipmentBase> findByPage(long pageNum, long pageSize,
                                   String equipmentCode, String equipmentName,
                                   String equipmentModel, String manufacturer);

    boolean saveWithCheck(EquipmentBase entity);

    boolean saveBatchWithCheck(List<EquipmentBase> entityList);

    boolean updateWithCheck(EquipmentBase entity);

    boolean removeWithCheck(String id);

    boolean removeBatchWithCheck(List<String> ids);

    boolean updateEquipmentStatus(String equipmentId, Integer currentStatus);

    boolean testEquipment(String equipmentId, String testType, String testDetail, String testUser);

    Map<String, Object> getEquipmentDetail(String equipmentId);

    List<EquipmentBase> getEquipmentByPoint(String pointId);
//    EquipmentBase getByIdTest(String id);

    /**
     * 分页查询监测设备台账列表
     * @param pageInDTO
     * @return
     */
    Page<EquipmentBaseOutDTO> findManholeDeviceByPage(ManholeDevicePageInDTO pageInDTO);

    /**
     * 查询井盖监测设备列表
     * @param listInDTO
     * @return
     */
    List<EquipmentBaseOutDTO> getManholeDataList(ManholeDeviceListInDTO listInDTO);

    /**
     * 根据设备类别分组统计设备数量
     * @param inDTO
     * @return
     */
    List<EquipmentCountByTypeOutDTO> countByType(EquipmentCountByTypeInDTO inDTO);

    /**
     * 导出设备明细数据
     * @param inDTO
     * @return
     */
    List<EquipmentExportOutDTO> exportEquipmentDetail(EquipmentExportInDTO inDTO);

    /**
     * 按顶级设备类型（燃气/排水/供水）查询设备列表
     * @param typeName 顶级类型名称
     * @return 设备列表
     */
    List<EquipmentBase> findByTopLevelType(String typeName);
}
