/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.dmAccessTraffic.service;

import com.alibaba.fastjson.JSONObject;
import me.zhengjie.modules.dmAccessTraffic.domain.DmAccessTraffic;
import me.zhengjie.modules.dmAccessTraffic.service.dto.CallbackAccessTrafficDto;
import me.zhengjie.modules.dmAccessTraffic.service.dto.DmAccessTrafficDto;
import me.zhengjie.modules.dmAccessTraffic.service.dto.DmAccessTrafficQueryCriteria;
import org.springframework.data.domain.Pageable;

import java.text.ParseException;
import java.util.Map;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;

/**
* @website https://el-admin.vip
* @description 服务接口
* @author zhirong
* @date 2021-11-22
**/
public interface DmAccessTrafficService {

    /**
    * 查询数据分页
    * @param criteria 条件
    * @param pageable 分页参数
    * @return Map<String,Object>
    */
    Map<String,Object> queryAll(DmAccessTrafficQueryCriteria criteria, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param criteria 条件参数
    * @return List<DmAccessTrafficDto>
    */
    List<DmAccessTrafficDto> queryAll(DmAccessTrafficQueryCriteria criteria);

    /**
     * 根据ID查询
     * @param id ID
     * @return DmAccessTrafficDto
     */
    DmAccessTrafficDto findById(Long id);

    /**
    * 创建
    * @param resources /
    * @return DmAccessTrafficDto
    */
    DmAccessTrafficDto create(DmAccessTraffic resources) throws IOException, ParseException;

    /**
    * 编辑
    * @param resources /
    */
    void update(DmAccessTraffic resources);

    /**
    * 多选删除
    * @param ids /
    */
    void deleteAll(Long[] ids);

    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
    void download(List<DmAccessTrafficDto> all, HttpServletResponse response) throws IOException;

    Map<String,Object> homePageYkt();

    List<Map<String,String>> YunUserRequest();

    /**
     * 创建
     * @param json /
     * @return DmAccessTrafficDto
     */
    DmAccessTraffic callbackAccessTraffic(JSONObject json);

    /**
     * 根据通行时间查询数据
     * @param start 开始时间
     * @param end 结束时间
     * @return List<Map<String,String>>
     */
    List<Map<String,String>> queryByAccessTime(String start, String end);

    /**
     * 根据通行人，通行设备，通行时间查询时间
     * @param userNumber 用户code
     * @param roomDevice 设备code
     * @param accessTime 通行时间
     * @return List<Map<String,String>>
     */
    List<Map<String,String>> queryByRoomDevice(String userNumber, String roomDevice, String accessTime);
}