package com.ho.business.mapper;

import com.ho.business.entity.DeviceTypeCol;
import com.ho.business.entity.ModelDeviceColComp;
import com.ho.business.vo.req.DeviceTypeColReqVO;
import com.ho.business.vo.resp.deviceTypeCol.DeviceTypeColCountResp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * @author gyan
 * @description 针对表【device_type_col】的数据库操作Mapper
 * @createDate 2023-02-09 17:46:50
 * @Entity generator.domain.DeviceTypeCol
 */
@Mapper
public interface DeviceTypeColMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(DeviceTypeCol deviceTypeCol);

    int insertList(@Param("deviceTypeColList")List<DeviceTypeCol> deviceTypeColList);

    int insertSelective(DeviceTypeCol deviceTypeCol);

    int updateByPrimaryKeySelective(DeviceTypeCol deviceTypeCol);

    int updateByPrimaryKey(DeviceTypeCol deviceTypeCol);

    int updateList(@Param("deviceTypeColList")List<DeviceTypeCol> deviceTypeColList);
    //deviceType查询
    List<DeviceTypeCol> selectByDeviceType(@Param("deviceType")String deviceType,@Param("lang") String lang);

    List<DeviceTypeCol> selectByParam(@Param("deviceTypeCol") DeviceTypeCol deviceTypeCol);

    //deviceType查询
    List<DeviceTypeCol> selectByDeviceTypeList(@Param("deviceTypeColReqVO") DeviceTypeColReqVO deviceTypeColReqVO);

    //deviceType查询
    List<DeviceTypeCol> selectByDeviceTypeAndIsShow(@Param("deviceType") String deviceType,@Param("isShow") Integer isShow);

    //根据id进行批量查询
    List<DeviceTypeCol> selectByIds(@Param("ids") List<Integer> deviceColIds);

    /**
     * @param type      :device 设备 model 模型
     * @param typeName: 设备或模型的具体类型 , 例如　inverter_huawei  或者 inverter
     * @return
     */
    List<ModelDeviceColComp> getCompListByType(@Param("type") String type, @Param("typeName") String typeName, @Param("modelCol") String modelCol);


    List<DeviceTypeCol> selectSameCol(@Param("deviceType") String deviceType, @Param("list") List<String> collect,@Param("lang")  String lang);

    //批量新增设备表字段
    void addBatchDevice(@Param("list") List<DeviceTypeCol> deviceTypeColList);

    //批量删除设备字段
    void deleteBatchDevice(List<Integer> ids);

    //批量删除模型字段
    void deleteBatchModel(List<Integer> ids);


    DeviceTypeCol selectTypeAndCol(String col, String deviceType,String lang);

    Integer selectCountByDeviceType(@Param("deviceTypeCol")DeviceTypeCol deviceTypeCol);

    /**
     * 注意：使用该接口拼接设备类型时，用于\\_拼接，可以使用常量CommonConstant.JOIN_STATION_ID
     * @param deviceType
     * @return
     */
    List<DeviceTypeCol> selectDimType(String deviceType);

    List<String> selectType(Set<String> collect);

    DeviceTypeCol selectById(Integer id);

    List<DeviceTypeCol> selectAllData(Integer colBeginId, Integer allNum);

    List<DeviceTypeCol> selectByBatchId(@Param("ids")List<Integer> deviceTypeIdList);

    //跟据设备类型统计个测点数据
    List<DeviceTypeColCountResp> countByDeviceType(@Param("typeList")List<String> typeList);
}
