package com.sckw.slope.detection.dao.mysql;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sckw.slope.detection.model.dos.mysql.KwsProjectDevice;
import com.sckw.slope.detection.model.dto.BaseItemDTO;
import com.sckw.slope.detection.model.vo.IntegrationItemVO;
import com.sckw.slope.detection.model.vo.ProjectVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
@DS("mysql")
public interface KwsProjectDeviceMapper extends BaseMapper<KwsProjectDevice> {
    int deleteByPrimaryKey(Long id);

    int insertSelective(KwsProjectDevice record);

    KwsProjectDevice selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(KwsProjectDevice record);

    int updateByPrimaryKey(KwsProjectDevice record);

    List<BaseItemDTO> selectDataByProjectId(@Param("id") long id);

    List<BaseItemDTO> selectDataByDeviceId(@Param("id") long id);

    /**
     * 设备id查项目数据
     * @param id 设备id
     * @return
     */
    ProjectVo selectProjectByDeviceId(@Param("deviceId") long id);

    /**
     * 设备id查项目数据
     * @param id 设备id
     * @return
     */
    ProjectVo selectNotDeleteProjectByDeviceId(@Param("deviceId") long id);

    /**
     * 设备id查项目数据
     * @param id 设备id
     * @return
     */
    KwsProjectDevice selectProjectDeviceByDeviceId(@Param("deviceId") long id);


    List<IntegrationItemVO> selectIntegrationItemByProjectId(@Param("id") long id);

    List<IntegrationItemVO> selectIntegrationItemByDeviceId(@Param("id") long id);
}