package com.zcxk.rmcp.web.service;

import com.zcxk.core.common.pojo.ResultMessage;
import com.zcxk.core.mysql.pageing.Pagination;
import com.zcxk.rmcp.api.dto.BasePageDto;
import com.zcxk.rmcp.api.dto.device.DeviceDataDto;
import com.zcxk.rmcp.api.dto.device.DeviceInputDto;
import com.zcxk.rmcp.api.dto.device.DeviceQueryDto;
import com.zcxk.rmcp.api.query.CommonQueryCondition;
import com.zcxk.rmcp.api.vo.*;
import com.zcxk.rmcp.core.entity.Device;
import com.zcxk.rmcp.web.excel.model.DeviceImportData;
import com.zcxk.rmcp.web.excel.model.ExcelData;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 
 * @author linqingwei
 * @date 2021-07-19 9:44
 */
public interface DeviceService{


    int insertSelective(Device record);

    int updateByPrimaryKeySelective(Device record);

    /*
     * @description 获取单个设备
     * @param id
     * @return com.zcxk.rmcp.core.entity.Device
     * @author linqingwei
     **/
    Device findById(Long id);

    Pagination<DeviceVo> getPage(DeviceQueryDto dto, BasePageDto page);

    void add(DeviceInputDto device);

    void edit(DeviceInputDto device);

    DeviceDetailVo deviceDetail(Long deviceId);

    /*
     * @description 批量删除
     * @param ids
     * @return void
     * @author linqingwei
     **/
    void batchDelele(List<Long> ids);

    /*
     * @description 全部删除
     * @param dto
     * @return void
     * @author linqingwei
     **/
    void allDelele(DeviceQueryDto dto);

    /*
     * @description 下载模板
     * @param categoryId
     * @param response
     * @return void
     * @author linqingwei
     **/
    void downTemplate(Integer categoryId, HttpServletResponse response);

    /**
    * 统计设备占比、状态数
    * @author Andy
    * @date 14:53 2021/8/3
    * @param :
    * @return com.zcxk.rmcp.api.vo.DeviceStatisticsVo
    **/
    DeviceStatisticsVo statisticsDevice();

    /**
    * 获取设备和小区信息
    * @author Andy
    * @date 14:53 2021/8/3
    * @param categoryId:
    * @return com.zcxk.rmcp.api.vo.DeviceMapDataVo
    **/
    DeviceMapDataVo listDeviceAndCommunityInfo(Integer categoryId);


    /*
     * @description 保存Excel
     * @param data
     * @param excelData
     * @return com.zcxk.core.common.pojo.ResultMessage
     * @author linqingwei
     **/
    ResultMessage saveExcelData(DeviceImportData data, ExcelData excelData);

    /*
     * @description 获取Excel
     * @param dto
     * @param httpServletResponse
     * @return void
     * @author linqingwei
     **/
    void getDeviceListExcel(DeviceQueryDto dto, HttpServletResponse httpServletResponse);

    /*
     * @description 批量开关阀门
     * @param ids
     * @param valveStatus
     * @return void
     * @author linqingwei
     **/
    void batchValve(List<Long> ids, Integer valveStatus);

    /**
     * @description  查询设备信息列表
     * @param deviceNo
     * @param meterNo
     * @return
     * @author linqingwei
     **/
    List<DeviceVo> queryDeviceInfoList(String deviceNo, String meterNo);
}
