package com.yeejoin.equipmanage.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto;
import com.yeejoin.amos.feign.morphic.model.ResourceDTO;
import com.yeejoin.equipmanage.common.datasync.entity.FireFightingSystem;
import com.yeejoin.equipmanage.common.dto.FireFightingSystemDto;
import com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity;
import com.yeejoin.equipmanage.common.entity.dto.EquipTypeAmountPageDTO;
import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.common.vo.*;

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

public interface IFireFightingSystemService extends IService<FireFightingSystemEntity> {

    /**
     * 根据系统id查询设备列表
     *
     * @param systemId
     * @return
     */
    List<EquiplistSpecificBySystemVO> getEquiplistBySystemId(Long systemId);

    /**
     * 根据系统id查询设备列表
     *
     * @param systemId
     * @return
     */
    IPage<EquiplistSpecificBySystemVO> getEquiplistBySystemIdPage(Long systemId, int size, int current);

    /**
     * 获取系列列表
     *
     * @param equimentName
     * @param equimentCode
     * @param construction
     * @param maintenance
     * @param current
     * @param pageSize
     * @return
     */
    Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId,String companyId, String nameOrCode, String systemStatus);

    FireFightingSystemEntity getOneById(Long id);

    /**
     * 根据系统id查询分组设备数量
     *
     * @param systemId
     * @return
     */
    List<EquipCountBySystemVO> getEquipCountBySystemId(Long systemId);

    /**
     * 保存
     *
     * @param vo
     * @return
     */
    String save(FireFightingSystemVo vo);

    /**
     * 修改
     *
     * @param vo
     * @return
     */
    String update(FireFightingSystemVo vo);

    /**
     * 创建画布
     *
     * @param model 模型
     * @return RiskSourceScene
     */
    FireFightingSystemVo createMorphic(FireFightingSystemVo model);

    /**
     * 更新画布
     *
     * @param resourceDTO 参数
     */
    ResourceDTO updateMorphic(ResourceDTO resourceDTO);


    /**
     * 获得点位区域树
     *
     * @param orgCode
     * @return
     */
    List<PointTreeVo> getPointTree(String systemId, String orgCode,String type);


    /**
     * 装备点性能指标接口
     *
     * @return
     */
    List<SpeIndexVo> getSpeIndex(Long id,int flag);

    /**
     * 列表查询
     *
     * @return List<FireFightingSystemEntity>
     */
    List<FireFightingSystemEntity> getList();

    /**
     * 获取详情
     *
     * @param id
     * @return
     */
    List<AlarmDataVO> getSystemById(Long id);

    IPage<EquipmentAlarmBySystemIdOrSourceIdVO> getEquipmentAlarmBySystemIdOrSourceIdVO(IPage<EquipmentAlarmBySystemIdOrSourceIdVO> page,Long sourceId,Long systemId,Integer confirmType,String createDate,String type, String equipmentId);

    /**
     * 删除装备系统
     *
     * @param id
     * @return
     */
    Boolean deleteSystem(Long id);

    /**
     * 删除画布
     *
     * @param id
     * @return
     */
    Boolean isDeleteCanvas(Long id);

    IPage<EquipTypeImgAmountVO> getColaCategoryAmountList(int hierarchy, String codeHead, EquipTypeAmountPageDTO equipTypeAmountPage);

    IPage<EquipTypeImgAmountVO> getColaCategoryAmountListIot(int hierarchy, String codeHead, EquipTypeAmountPageDTO equipTypeAmountPage);
    IPage<EquipTypeImgAmountVO> getColaCategoryAmountCarList(int hierarchy, String codeHead, EquipTypeAmountPageDTO equipTypeAmountPage);

    IPage<EquipTypeImgAmountVO> getColaCategoryAmountEquList(int hierarchy, String codeHead, EquipTypeAmountPageDTO equipTypeAmountPage);


    /**
     * 获取消防系统在装备分类的定义
     *
     * @return List<EquipmentManageVo>
     */
    List<EquipmentManageVo> getSystemCategory();

    /**
     * 根据具体条件，获取消防系统详情
     *
     * @param fireFightingSystemVo
     * @return
     */
    List<FireFightingSystem> getFireFightingSystemDetail(FireFightingSystemVo fireFightingSystemVo);

    /**
     * 通过codes的数组，获取消防系统集合
     *
     * @param idsArr
     * @return
     */
    List<FireFightingSystemEntity> getFightingSysByCodes(String[] idsArr);

    List<FireFightingSystem3dVo> get3dFightingSystemList();

    /**
     * 按照code查询详情
     *
     * @param systemCode 系统编号
     * @return FireFightingSystemEntity
     */
    FireFightingSystemEntity getDetailByCode(String systemCode);

    List<Map<String,Object>> getEquip(String bizOrgCode, String systemCode);

    List<Map<String, Object>> getFireSystemEquipStatusList(String bizOrgCode, String systemCode, String categoryCodes);

    /**
     * 集成页面系统数据
     *
     * @param systemCode 系统code
     * @param isUpdate   自动
     * @return Map<String, Object>
     */
    Map<String, Object> integrationPageSysData(String systemCode, Boolean isUpdate);

    /**
     * 根据bizOrgCode获取消防系统树
     *
     * @param bizOrgCode 登陆人的机构编码
     * @return list
     */
    List<FireFightingSystemTreeVo> getSystemTreeByOrgCode(String bizOrgCode);

    /**
     * 根据登录人及类型获取公司部门树
     *
     * @param type 默认查询公司及部门，公司：COMPANY，部门：DEPARTMENT
     * @return
     */
    List<OrgMenuDto> companyTreeByUserAndType(String type);

    /**
     * 获取消防系统类型树
     *
     * @return
     */
    List<FireFightingSystemTypeTreeVo> systemTypeTree(String bizOrgCode);

    /**
     * 获取列表不分页
     *
     * @param bizOrgCode orgCode
     * @return
     */
    List<FireFightingSystemEntity> systemListByBziOrgCode(String bizOrgCode);

    /**
     * 装备分类的类型和总数
     *
     * @param bizOrgCode
     * @return
     * @throws Exception
     */
    Object getEquipmentTypeAndCount(String bizOrgCode) throws Exception;

    /***
     * 车辆类型和统计值
     * @param bizOrgCode
     * @return
     * @throws Exception
     */
    Object getCarTypeAndCount(String bizOrgCode) throws Exception;

    Object refreshEquipmentTypeAndCount(String bizOrgCode) throws Exception;

    Object iotgetEquipmentTypeAndCount(String bizOrgCode) throws Exception;


    Object refreshCarTypeAndCount(String bizOrgCode) throws Exception;

    Map<String, Object> getSystemName(HashMap<String, Object> hashMap);

    Map<String, Object> getSystemStatus(HashMap<String, Object> hashMap);

    Integer getSystemStatusBySuper(HashMap<String, Object> hashMap);

    Map<String, Object> equipAlarmTOP(HashMap<String, Object> hashMap);

    Page<Map<String, Object>> getSmallWaterInfo(Page page, HashMap<String, Object> hashMap);

    Page<Map<String, Object>> equipmentState(Page result, HashMap<String, Object> hashMap);

    Page<Map<String, Object>> equipmentStateBySuper(Page result, HashMap<String, Object> hashMap);

    Map<String, Object> statisticsByStation(String bizOrgCode);

    Map<String, Object> todayAlarmEquipment(String bizOrgCode);

    Map<String, Object> todayAlarmMessage(String bizOrgCode);

    Map<String, Object> todayAlarmUnEliminateEquipment(String bizOrgCode);

    Map<String, Object> todayAlarmUnEliminateMessage(String bizOrgCode);

    List<Map<String, Object>> monthAlarm(String bizOrgCode);

    List<Map<String, Object>> yearsAlarm(String bizOrgCode);

    Page<Map<String, Object>> alarmList(Page page, String bizOrgCode);

    Page<Map<String, Object>> equipList(Page page, String bizOrgCode);
    /**
     * 获取系统告警数量等信息
     * @param companyCode
     * @return
     */
    BigScreenVo getSystemAlarmInfoNum(String companyCode);

    BigScreenVo getCarInfo(String companyCode);

    String iotMonthReport(String bizOrgCode, String startDate, String endDate);

    String iotWeekReport(String bizOrgCode, String startDate, String endDate);

    String iotDayReport(String bizOrgCode, String startDate, String endDate);

    Page<Map<String, Object>> getWaterInfo(Page page, String companyCode, String systemCode);

    Page<Map<String, Object>> getSystemInfo(Page page, String companyCode, String systemCode);

    List<Map<String, Object>> getEquipExpiryStatistics(String bizOrgCode, Integer expiryDayNum);

    Page<Map<String, String>> getEquipExpiryListByPage(String bizOrgCode, Integer expiryDayNum, Page page);

    List<Map<String, Integer>> getStockEquipStatistics(String bizOrgCode);

    List<Map<String, Object>> getSystemInfoList();

    List<Map<String, Object>> getSystemAlarmInfoList(String startDate, String endDate);

    List<Map<String, Object>> getSystemRunningInfoList();

    Page<FireFightingSystemDto> fireSysRunStatusPage(Page<Map<String, Object>> page, String bizOrgCode);

    List<OrgMenuDto> systemAndEquipmentTreeByBziOrgCode();

    Map<String, Object> getSystemDetailByCode(String systemCode);

    Map<String, Object> getStationConnectStatus();

    List<Map<String, Object>> getStationStatusStatistics();
    
    /**
     * 重置画布
     *
     * @param resourceDTO 参数
     */
    void resetMorphic();

    Map<String, Object> getFireWaterStatics(String bizOrgCode);

    Map<String, Object> getFireWaterInfo(String bizOrgCode);

    Page<Map<String, Object>> getWaterInfoPage(Page<Map<String, Object>> page, String bizOrgCode, String type, String status);

}
