package com.inspect.metadata.prodevmnt.mapper;

import com.inspect.metadata.area.domain.BaseDataArea;
import com.inspect.metadata.prodevmnt.domain.BasedataDevice;
import com.inspect.metadata.prodevmnt.domain.TreeModule;

import java.util.List;

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

@Mapper
public interface BasedataDeviceMapper {
    BasedataDevice selectBasedataDeviceByDeviceId(Long deviceId);

    List<BasedataDevice> selectBasedataDeviceList(BasedataDevice device);
    List<BasedataDevice> selectBasedataDeviceRelationList(BasedataDevice device);

    List<BasedataDevice> selectBasedataDeviceListFilterByMeter(BasedataDevice device);

    List<BasedataDevice> selectBasedataDeviceListWithPreset(BasedataDevice device);

    List<TreeModule> selectAreaAndDeviceTree(BasedataDevice device);

    List<TreeModule> selectPointList();

    List<BasedataDevice> selectBasedataTreeByEqBookCode(BasedataDevice device);

    int insertBasedataDevice(BasedataDevice device);

    int updateBasedataDevice(BasedataDevice device);

    int deleteBasedataDeviceByDeviceId(Long deviceId);

    int deleteBasedataDeviceByDeviceIds(Long[] deviceIds);

    BasedataDevice selectBasedataDeviceByPatrolPointId(String pointId);

    List<BasedataDevice> selectBasedataDeviceMainEquBatchByAreas(@Param("areas") List<BaseDataArea> areas);

    List getDeviceAllDeviceCode();

    BasedataDevice checkDeviceNameUnique(@Param("deviceName") String deviceName, @Param("deviceId") Long deviceId);

    BasedataDevice checkDeviceCodeUnique(@Param("deviceCode") String deviceCode, @Param("deviceId") Long deviceId);

    List checkDeviceNameIsExist(@Param("deviceName") String deviceName, @Param("deviceId") String deviceId);

    List<BasedataDevice> selectPatrolPointList(Long[] ids);

    int deleteBySendCode(@Param("sendCode") String sendCode);

    int updateBasedataDeviceRelation(@Param("toAreaId") Long toAreaId, @Param("deviceId") Long deviceId);

    BasedataDevice selectBasedataDeviceRelationByDeviceId(Long toDeviceId);
}
