package com.casic.missiles.modular.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.casic.missiles.modular.system.dao.DeviceModelsMapper;
import com.casic.missiles.modular.system.model.DeviceModels;
import com.casic.missiles.modular.system.service.IDeviceModelsService;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 设备型号表 服务实现类
 * </p>
 *
 * @author lwh123
 * @since 2019-05-23
 */
@Service
public class DeviceModelsServiceImpl extends ServiceImpl<DeviceModelsMapper, DeviceModels> implements IDeviceModelsService {

    @Override
    public DeviceModels selectDeviceModelsBymodelName(String modelName) {
        QueryWrapper<DeviceModels> query = new QueryWrapper();
        query.eq("model_name", modelName);
        return this.baseMapper.selectOne(query);
    }

    @Override
    public int countDeviceByModels(Serializable modelId) {
        return this.baseMapper.countDeviceByModels(modelId);
    }

    @Override
    public List<DeviceModels> selectList(Long deviceType) {
        return this.baseMapper.selectModelList(deviceType);
    }

}
