package com.common.service;

import com.common.entity.DeviceInterlocking;
import com.common.mapper.DeviceInterlockingMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class DeviceInterlockingService {

    @Autowired
    private DeviceInterlockingMapper interlockingMapper;

    /**
     * 根据ID查询
     */
    public DeviceInterlocking selectById(Long id) {
        return interlockingMapper.selectById(id);
    }

    /**
     * 根据部门ID查询联动设备
     */
    public List<DeviceInterlocking> selectByDeptId(String deptId) {
        return interlockingMapper.selectByDeptId(deptId);
    }

    /**
     * 根据厂商查询
     */
    public List<DeviceInterlocking> selectByVendor(String vendor) {
        return interlockingMapper.selectByVendor(vendor);
    }

    /**
     * 插入记录
     */
    public int insert(DeviceInterlocking device) {
        return interlockingMapper.insert(device);
    }

    /**
     * 更新记录
     */
    public int update(DeviceInterlocking device) {
        return interlockingMapper.update(device);
    }

    /**
     * 查询所有记录
     */
    public List<DeviceInterlocking> selectAll() {
        return interlockingMapper.selectAll();
    }
}
