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.KwsProject;
import com.sckw.slope.detection.model.dto.HeaderData;
import com.sckw.slope.detection.model.param.DeviceQuery;
import com.sckw.slope.detection.model.vo.ProjectDeviceVO;
import com.sckw.slope.detection.model.param.ProjectQuery;
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 KwsProjectMapper extends BaseMapper<KwsProject> {

    /**
     * 分页查询
     *
     * @param projectQueryDto
     * @return
     */
    List<ProjectVo> selectByProjectParam(@Param("projectQueryDto") ProjectQuery projectQueryDto, @Param("companyId") String companyId);

    List<ProjectDeviceVO> selectDeviceByProjectId(@Param("mountainId") String mountainId, @Param("projectId") Long projectId,
                                                  @Param("deviceId") Long deviceId, @Param("type") String type);

    List<ProjectDeviceVO> selectDeviceList(@Param("deviceQuery") DeviceQuery deviceQuery);

    /**
     * 设备没有建立主从设备的数据
     * @param deviceQuery
     * @return
     */
    List<ProjectDeviceVO> selectDeviceNotBindList(@Param("deviceQuery") DeviceQuery deviceQuery);

    /**
     * 查询设备没有和项目关联的数据
     * @param deviceQuery
     * @param headerData
     * @return
     */
    List<ProjectDeviceVO> selectNotBindDeviceList(@Param("deviceQuery") DeviceQuery deviceQuery, @Param("headerData") HeaderData headerData);

    List<KwsProject> selectListData(@Param("ids") List<String> ids, @Param("delFlag") Integer delFlag);

    List<KwsProject> selectListByType(@Param("projectType") String projectType);

    /**
     * 设备没有建立主从没有和项目绑定的数据
     * @param deviceQuery
     * @param headerData
     * @return
     */
    List<ProjectDeviceVO> selectNotBindProjectDeviceAll(@Param("deviceQuery") DeviceQuery deviceQuery, @Param("headerData") HeaderData headerData);
}