package com.handong.smartservice.mapper;

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

import com.handong.smartservice.component.CtResponse;

import java.util.List;
import java.util.Map;

@Mapper
public interface TerminalMapper {
    List<Map<String, Object>> selectTerminal(Boolean isCount, Boolean is_excel, Long offset, Long limit, Boolean is_group_access, 
        Long biz_group_id, String name, Long state, String date_start, String date_end);

    Map<String, Object> selectTerminalById(Long terminal_id);

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

    Map<String, Object> selectTerminal3(String uid1, Long type);

    Map<String, Object> selectExistTerminal(String name, String uid1, Long type);
    
    int insertTerminal(Map<String, Object> params);

    int updateTerminal(Long terminal_id, String name, String uid1, Long type, String manager_name, Long gid);

    int updateTerminalChangeDevice(Long terminal_id, Long device_id, Long state, String name);
    int updateTerminalRemoveDevice(Long device_id);
    
    int changeStateTerminal(Long terminal_id, int state);
    int changeStateTerminals(List<Long> ids, int state);

    int changeStateDeviceTerminal(Long device_id, int state);

    //int deleteTerminal(List<Long> ids);
    int deleteTerminal(Long terminal_id);

    //
    int insertTerminalBizGroup(Long biz_group_id, Long terminal_id);

    int deleteTerminalBizGroup(Long biz_group_id, Long terminal_id);

    //
    int terminalState(String uid1, Long type, Long state);
}
