package com.willalp.control.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.willalp.common.utils.SecurityUtils;
import com.willalp.control.domain.HsControlUsenoConfig;
import com.willalp.control.mapper.HsControlUsenoConfigMapper;
import com.willalp.control.service.IHsControlUsenoConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 空开设备号口配置Service业务层处理
 *
 * @author willalp
 * @date 2022-02-21
 */
@Service
public class HsControlUsenoConfigServiceImpl extends ServiceImpl<HsControlUsenoConfigMapper, HsControlUsenoConfig> implements IHsControlUsenoConfigService {
    @Autowired
    private HsControlUsenoConfigMapper hsControlUsenoConfigMapper;

    /**
     * 查询空开设备号口配置列表
     *
     * @param hsControlUsenoConfig 空开设备号口配置
     * @return 空开设备号口配置
     */
    @Override
    public List<HsControlUsenoConfig> selectHsControlUsenoConfigList(HsControlUsenoConfig hsControlUsenoConfig) {
        return hsControlUsenoConfigMapper.selectHsControlUsenoConfigList(hsControlUsenoConfig);
    }

    @Override
    public List<HsControlUsenoConfig> canAddUseNoListList() {
        Long userId = SecurityUtils.getUserId();
        return this.baseMapper.canAddUseNoListList(userId);
    }
}
