package com.inspect.metadata.patrolpointmnt.mapper;

import com.inspect.metadata.patrolpointmnt.domain.BasedataPatrolPoint;
import com.inspect.metadata.patrolpointmnt.domain.vo.PointLatestResultVo;
import com.inspect.metadata.patrolpointmnt.domain.vo.PointStatsVo;
import com.inspect.system.base.domain.SysDictData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

@Mapper
public interface BasedataPatrolPointMapper {
    BasedataPatrolPoint selectBasedataPatrolPointByPatrolPointId(Long patrolPointId);

    List<BasedataPatrolPoint> selectBasedataPatrolPointList(BasedataPatrolPoint patrolPoint);

    List<BasedataPatrolPoint> selectBasedataMonitorList(BasedataPatrolPoint patrolPoint);
    List<BasedataPatrolPoint> selectBasedataMonitorRelationList(BasedataPatrolPoint patrolPoint);

    List<BasedataPatrolPoint> selectBasedataMonitorUnionList(BasedataPatrolPoint patrolPoint);

    int insertBasedataPatrolPoint(BasedataPatrolPoint patrolPoint);

    int updateBasedataPatrolPoint(BasedataPatrolPoint patrolPoint);

    int deleteBasedataPatrolPointByPatrolPointId(Long patrolPointId);

    int deleteBasedataPatrolPointByPatrolPointIds(Long[] patrolPointIds);

    int selectPresetPosByPatrolPointId(Long[] patrolPointIds);

    BasedataPatrolPoint selectBasedataPatrolPointPresetForOne(BasedataPatrolPoint patrolPoint);

    List<BasedataPatrolPoint> selectBasedataPatrolPointPresetByMainDeviceIds(@Param("mainDeviceIds") List<Long> mainDeviceIds);

    List<BasedataPatrolPoint> selectBasedataPatrolPointListByMainDeviceIds(@Param("mainDeviceIds") List<Long> mainDeviceIds);

    PointStatsVo getInspectPointStats(PointStatsVo pointStatsVo);

    List<PointLatestResultVo> pointLatestResult(PointLatestResultVo pointLatestResultVo);

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

    List<BasedataPatrolPoint> selectBasedataPatrolPointListByDeviceIds(@Param("deviceIds") List<Long> deviceIds);
    List<BasedataPatrolPoint> selectBasedataPatrolPointRelationListByDeviceIds(@Param("deviceIds") List<Long> deviceIds);
    List<BasedataPatrolPoint> selectBasedataPatrolPointWithPresetRelationListByDeviceIds(@Param("deviceIds") List<Long> deviceIds);


    void updateBasedataPatrolPointRelation(@Param("toAreaId") Long toAreaId, @Param("deviceId") Long deviceId);

    void batchUpdateBasedataPatrolPointRelation(@Param("toAreaId") Long toAreaId,@Param("toParentId") Long toParentId,@Param("toDeviceId") Long toDeviceId,@Param("patrolPointIds") List<Long> patrolPointIds);

    List<SysDictData> selectDictDataByType(String point_device_type);
}