package com.handong.smartservice.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Mapper
public interface DeviceMapper {
    List<Map<String, Object>> selectDevice(Boolean isCount, boolean is_excel, Long offset, Long limit, Boolean is_group_access,
        Long biz_group_id, String name, String date_start, String date_end);
    
    List<Map<String, Object>> selectDevice2(Boolean isCount, boolean is_excel, Long offset, Long limit,
        Long biz_group_id, String name, String date_start, String date_end);

    Map<String, Object> selectDeviceById(Long device_id);

    Map<String, Object> selectExistDevice(Long device_id, String name);
    
    int insertDevice(Map<String, Object> params);

    int updateDevice(Long device_id, Long terminal_id, String name, String uid1, String manager_name, Long gid);
    
    int updateDeviceTerminalTime(Long device_id, LocalDateTime connect_time, LocalDateTime disconnect_time);
    
    int changeStateDevice(List<Long> ids, int state);

    //int deleteDevice(List<Long> ids);
    int deleteDevice(Long device_id);

    //
    int insertDeviceBizGroup(Long biz_group_id, Long device_id);

    int deleteDeviceBizGroup(Long biz_group_id, Long device_id);

    List<Map<String, Object>> selectDeviceByError(Long biz_group_id);
}
