package com.zcxk.dao;

import com.zcxk.entity.SceneEntity;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
 *
 * sms_sceneDAO接口
 * @author: WYY
 * @date 2020-11-17 21:15
 */
@Mapper
public interface SceneMapper extends BaseMapper<SceneEntity> {

    /**
     * 自定义分页查询
     *
     * @param page
     */
    Page<SceneEntity> findPage(IPage<SceneEntity> page, @Param(value = "scene") SceneEntity sceneEntity);

    SceneEntity findSceneById(Serializable id);

    List<SceneEntity> findList(@Param(value = "scene") SceneEntity sceneEntity);

    List<SceneEntity> findBySceneTypeIds(@Param(value = "Ids") Long[] Ids);

    List<SceneEntity> findByParentSceneIds(@Param(value = "Ids") Long[] Ids);

    List<SceneEntity> findByParentIdsLike(@Param(value = "scene") SceneEntity sceneEntity);

    List<SceneEntity> selectByTypeName(@Param(value = "scene")SceneEntity sceneEntity);

    List<SceneEntity> findByParentId(@Param(value = "scene")SceneEntity sceneEntity);

    SceneEntity findParentSceneById(@Param(value = "id")Long id);

    List<Map<String,Object>> findSceneAmount(@Param("scene") SceneEntity sceneEntity,@Param("months") Integer months);

    List<Map<String,Object>> selectAlarmSceneAndDevice(@Param("scene") SceneEntity sceneEntity, @Param("startDate") String startDate, @Param("endDate") String endDate);

    List<Map<String,Object>> selectMonthAlarmTimes(@Param("scene") SceneEntity sceneEntity, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("sort") int sort);

    List<Map<String,Object>> selectYearAlarmTimes(@Param("scene") SceneEntity sceneEntity, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("sort") int sort);

    List<Map<String,Object>> selectAlarmDeviceIdBySenceId(@Param("id") int id);

    List<Map<String,Object>> selectAlarmLable(@Param("scene") SceneEntity sceneEntity, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("sort") int sort);
    /**删除相关方法  使用mybatis-plus集成的 **/
}
