package com.ho.business.mapper;

import com.ho.business.entity.ModelDevice;
import com.ho.business.entity.ModelDeviceCol;
import com.ho.business.vo.resp.deviceModel.ModelDeviceColRespVo;
import com.ho.business.vo.resp.modelType.ModelColData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author gyan
* @description 针对表【model_device_col】的数据库操作Mapper
* @createDate 2023-02-09 18:04:50
* @Entity generator.domain.ModelDeviceCol
*/
@Mapper
public interface ModelDeviceColMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(ModelDeviceCol modelDeviceCol);

    int insertSelective(ModelDeviceCol modelDeviceCol);

    int updateByPrimaryKeySelective(ModelDeviceCol modelDeviceCol);

    //deviceType查询
    List<ModelDeviceCol> selectByDeviceType(String deviceType);


    List<ModelDeviceCol> selectByIds(@Param("ids") List<Integer> deviceColIds);


    List<ModelDeviceCol> selectByDeviceIds(@Param("ids")List<Integer> ids,String deviceType);

    List<ModelDeviceCol> selectByModelIds(@Param("ids") List<Integer> ids,String deviceType);

    List<ModelDeviceCol> selectByDeviceTypeList(List<String> list);

    void addBatch(List<ModelDeviceCol> modelDeviceCols);

    /**
     * 批量插入
     * @param list
     * @return
     */
    int insertList(@Param("list")List<ModelDeviceCol> list);

    void deleteBatchDevice(@Param("ids") List<Integer> ids);

    List<ModelDeviceCol> selectByType(String deviceType, String modelType,Integer deviceColId,Integer modelColId);

    List<ModelDeviceCol> selectByModelType(String type,@Param("ids")List<Integer> collect);

    List<ModelDevice> selectByModelTypes(String modelType);

    ModelDeviceCol selectByModelId(@Param("deviceType")String deviceType, @Param("modelColId")Integer modelColId);

    /**
     * 根据设备类型模型检索（一键同步功能使用）
     * @param deviceType
     * @return
     */
    List<ModelDeviceColRespVo> selectByParam(@Param("deviceType")String deviceType);

    /**
     * 根据设备类型模糊删除（一键同步功能使用）
     * @param deviceType
     * @return
     */
    int deleteByDeviceType(@Param("deviceType") String deviceType);

    List<ModelDeviceCol> selectDeviceColsByIds(@Param("ids")List<Integer> modelColIdList,@Param("deviceTypeList")List<String> deviceTypeList);

    /**
     * 根据id查询绑定的模型点
     * @param ids
     * @return
     */
    List<ModelColData> selectModelData(@Param("ids")List<Integer> ids);

    int getStationModelColCount(String stationId,String modelId);
}
