package cn.cecep.talroad.mapper;

import cn.cecep.talroad.domain.BasDevice;
import cn.cecep.talroad.vo.BasDeviceDCSSystemParamExcelVo;
import cn.cecep.talroad.vo.BasDeviceDCSSystemParamVo;
import cn.cecep.talroad.vo.BasDeviceVo;
import cn.cecep.talroad.vo.FactoryDeviceVo;
import cn.cecep.talroad.vo.MapPointVo;
import cn.cecep.talroad.vo.query.BasDeviceDCSSystemParamQuery;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 设备信息(有组织)Mapper接口
 *
 * @author szhpt
 * @date 2023-01-10
 */
@Mapper
public interface BasDeviceMapper extends BaseMapper<BasDevice> {
    /**
     * 查询设备信息(有组织)列表
     *
     * @param basDevice 设备信息(有组织)
     * @return 设备信息(有组织)集合
     */
    public List<BasDevice> selectBasDeviceList(BasDevice basDevice);

    List<Map<String, Object>> selectDeviceType(String industryCategory);

    List<MapPointVo> selectMapPoints(@Param("factoryId") String factoryId);

    void updateBatchCoordinate(List<BasDeviceVo> basDeviceSiteVoList);

    List<String> groupByWorkStepSelect(@Param("factoryId") String factoryId, @Param("industryCategory") String industryCategory);

    IPage<BasDeviceDCSSystemParamVo> listDCSSystemParam(IPage<BasDeviceDCSSystemParamVo> page,
                                                        @Param("query") BasDeviceDCSSystemParamQuery query);

    List<BasDeviceDCSSystemParamExcelVo> exportDCSSystemParam(@Param("query")BasDeviceDCSSystemParamQuery query);

    List<String> groupByParamNameSelect(@Param("factoryId") String factoryId, @Param("industryCategory") String industryCategory);
    FactoryDeviceVo selectFactoryDeviceVoByDeviceId(@Param("deviceId") String deviceId);

    List<Map<String, Object>> selectDeviceStatusChart(@Param("deviceId") String deviceId, @Param("startTime") String startTime, @Param("endTime") String endTime);

    BasDeviceVo.CountOverview selectCountOverview(@Param("regionCodeList") List<String> regionCodeList);

    BasDeviceVo.CoalCountOverview selectCoalCountOverview(@Param("regionCodeList") List<String> regionCodeList);

    List<BasDeviceVo.CoalDiffuse> selectCoalDiffuseList(@Param("deviceName") String deviceName, @Param("status") String status, @Param("regionCodeList") List<String> regionCodeList);

    List<MapPointVo> selectCoalMapPoints(@Param("name") String name);

    List<BasDevice> selectListByIndustry(@Param("industry") String industry, @Param("dataType") String dataType);
}
