package com.ruoyi.system.service;

import com.ruoyi.system.domain.SysController;
import com.ruoyi.system.domain.SysDevice;
import com.ruoyi.system.mapper.SysControllerMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SysControllerService {
    @Resource
    public SysControllerMapper sysControllerMapper;
    public void insertsyscontroller(@Param("controllerId")String controllerId,
                             @Param("timestamp")String timestamp,
                             @Param("fleetId")String fleetId,
                             @Param("name")String name,
                             @Param("path")String path){
        sysControllerMapper.insertsyscontroller(controllerId, timestamp, fleetId, name, path);
    }
    public void insertsyscontrollercmd(@Param("controllerId")String controllerId,
                                    @Param("timestamp")String timestamp,
                                    @Param("fleetId")String fleetId,
                                    @Param("name")String name,
                                    @Param("path")String path){
        sysControllerMapper.insertsyscontrollercmd(controllerId, timestamp, fleetId, name, path);
    }


    public void insertsyscontrollerfault(@Param("controllerId")String controllerId,
                                       @Param("timestamp")String timestamp,
                                       @Param("fleetId")String fleetId,
                                       @Param("name")String name,
                                       @Param("path")String path){
        sysControllerMapper.insertsyscontrollerfault(controllerId, timestamp, fleetId, name, path);
    }

    public Integer selectsyscontrollercount(@Param("path")String paht){
        return sysControllerMapper.selectsyscontrollercount(paht);
    }
    public Integer selectsyscontrollercountcmd(@Param("path")String paht){
        return sysControllerMapper.selectsyscontrollercountcmd(paht);
    }
    public Integer selectsyscontrollercountfault(@Param("path")String paht){
        return sysControllerMapper.selectsyscontrollercountfault(paht);
    }

    public void updatesyscontroller(@Param("controllerId")String controllerId,
                             @Param("timestamp")String timestamp,
                             @Param("fleetId")String fleetId,
                             @Param("name")String name,
                             @Param("path")String path){
        sysControllerMapper.updatesyscontroller(controllerId, timestamp, fleetId, name, path);
    }
    public SysController selectcontrollerpath(@Param("path")String path){
        return sysControllerMapper.selectcontrollerpath(path);
    }
    public List<String> selectall(){
        return sysControllerMapper.selectall();
    }
    public SysDevice selectjingweidu(String tableName, String Name){
        return sysControllerMapper.selectjingweidu(tableName, Name);
    }


}
