package com.zcxk.charge.core.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zcxk.charge.api.dto.*;
import com.zcxk.charge.api.vo.DeviceParmInfoVo;
import com.zcxk.charge.api.vo.ParmTypeCountVo;
import com.zcxk.charge.api.vo.ReportAttributeVo;
import com.zcxk.charge.core.entity.DeviceParmEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @description
 * @author  wangli
 * @data 2020-11-17 10:57
 */
@Mapper
public interface DeviceParmMapper  {

    /**
    * 查询单个设备
    * @author Andy
    * @date 18:49 2021/8/17
    * @param id:
    * @return com.zcxk.charge.core.entity.DeviceParmEntity
    **/
    DeviceParmEntity selectById(Integer id);

    /**
    * 添加设备
    * @author Andy
    * @date 18:49 2021/8/17
    * @param deviceEntity:
    * @return java.lang.Integer
    **/
    Integer insert(DeviceParmEntity deviceEntity);

    /**
    * 批量插入设备信息
    * @author Andy
    * @date 18:49 2021/8/17
    * @param deviceParms:
    * @return java.lang.Integer
    **/
    Integer batchInsert(@Param("deviceParms") List<DeviceParmEntity> deviceParms);

    /**
    * 单条删除设备
    * @author Andy
    * @date 18:49 2021/8/17
    * @param id:
    * @return java.lang.Integer
    **/
    Integer deleteById(Integer id);

    /**
    * 单条删除设备
    * @author Andy
    * @date 18:49 2021/8/17
    * @param deviceId:
    * @return java.lang.Integer
    **/
    Integer deleteByDeviceId(Integer deviceId);

    /**
    * 修改设备信息
    * @author Andy
    * @date 18:49 2021/8/17
    * @param deviceEntity:
    * @return java.lang.Integer
    **/
    Integer update(DeviceParmEntity deviceEntity);

    /**
    * 查询设备信息
    * @author Andy
    * @date 18:50 2021/8/17
    * @param deviceParmEntity:
    * @return java.util.List<com.zcxk.charge.core.entity.DeviceParmEntity>
    **/
    List<DeviceParmEntity> selectList(DeviceParmEntity deviceParmEntity);

    /**
    * 分页查询
    * @author Andy
    * @date 18:50 2021/8/17
    * @param page:
    * @param deviceParmEntity:
    * @return com.baomidou.mybatisplus.core.metadata.IPage<com.zcxk.charge.core.entity.DeviceParmEntity>
    **/
    IPage<DeviceParmEntity> selectPage(IPage<DeviceParmEntity> page, DeviceParmEntity deviceParmEntity);

    /**
    * 根据场景和设备id查询集合
    * @author Andy
    * @date 18:50 2021/8/17
    * @param sceneId:
    * @param id:
    * @return java.util.List<com.zcxk.charge.core.entity.DeviceParmEntity>
    **/
    List<DeviceParmEntity> selectByDeviceId(@Param("sceneId") Integer sceneId, @Param("id") Integer id);

    /**
    * selectByDeviceIdForGis
    * @author Andy
    * @date 18:50 2021/8/17
    * @param sceneId:
    * @param id:
    * @return java.util.List<com.zcxk.charge.core.entity.DeviceParmEntity>
    **/
    List<DeviceParmEntity> selectByDeviceIdForGis(@Param("sceneId") Integer sceneId, @Param("id") Integer id);

    /**
    * findAttributeNameList
    * @author Andy
    * @date 18:50 2021/8/17
    * @param reportDto:
    * @return java.util.List<com.zcxk.charge.api.vo.ReportAttributeVo>
    **/
    List<ReportAttributeVo> findAttributeNameList(@Param("report") ReportDto reportDto);

    /**
    * findHistoryDataAttributeNameList
    * @author Andy
    * @date 18:50 2021/8/17
    * @param reportDto:
    * @return java.util.List<com.zcxk.charge.api.vo.ReportAttributeVo>
    **/
    List<ReportAttributeVo> findHistoryDataAttributeNameList(@Param("report") ReportDto reportDto);

    /**
    * findBySceneDeviceId
    * @author Andy
    * @date 18:50 2021/8/17
    * @param deviceParmInfo:
    * @return java.util.List<com.zcxk.charge.api.vo.DeviceParmInfoVo>
    **/
    List<DeviceParmInfoVo> findBySceneDeviceId(@Param("info") DeviceParmInfoDto deviceParmInfo);

    /**
    * selectBindByDeviceId
    * @author Andy
    * @date 18:51 2021/8/17
    * @param sceneId:
    * @param deviceId:
    * @return java.util.List<com.zcxk.charge.api.vo.DeviceParmInfoVo>
    **/
    List<DeviceParmInfoVo> selectBindByDeviceId(@Param("sceneId") Long sceneId, @Param("deviceId") Long deviceId);

    /**
    * selectDeviceBySceneIdAndType
    * @author Andy
    * @date 18:51 2021/8/17
    * @param deviceParmEntity:
    * @return java.util.List<com.zcxk.charge.core.entity.DeviceParmEntity>
    **/
    List<DeviceParmEntity> selectDeviceBySceneIdAndType(@Param("info") DeviceParmEntity deviceParmEntity);

    /**
    * findAlarmCount
    * @author Andy
    * @date 18:51 2021/8/17
    * @param deviceParmEntity:
    * @return java.util.List<com.zcxk.charge.api.vo.ParmTypeCountVo>
    **/
    List<ParmTypeCountVo> findAlarmCount(@Param("info") DeviceParmEntity deviceParmEntity);

    /**
    * findAlarmTotalCount
    * @author Andy
    * @date 18:51 2021/8/17
    * @param deviceParmEntity:
    * @return java.util.List<com.zcxk.charge.api.vo.ParmTypeCountVo>
    **/
    List<ParmTypeCountVo> findAlarmTotalCount(@Param("info") DeviceParmEntity deviceParmEntity);

    /**
    * TfindAlarmCountTotalCount
    * @author Andy
    * @date 18:51 2021/8/17
    * @param deviceParmEntity:
    * @return java.util.List<com.zcxk.charge.api.vo.ParmTypeCountVo>
    **/
    List<ParmTypeCountVo> findAlarmCountTotalCount(@Param("info") DeviceParmEntity deviceParmEntity);

    /**
    * selectBySceneId
    * @author Andy
    * @date 18:51 2021/8/17
    * @param sceneId:
    * @return java.util.List<com.zcxk.charge.core.entity.DeviceParmEntity>
    **/
    List<DeviceParmEntity> selectBySceneId(@Param("sceneId") Integer sceneId);

    /**
    * updateStatisticalDimension
    * @author Andy
    * @date 18:51 2021/8/17
    * @param statisticalDimensionDto:
    * @return java.lang.Integer
    **/
    Integer updateStatisticalDimension(ReportStatisticalDimensionDto statisticalDimensionDto);
}
