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.DeviceTypeMapper;
import com.casic.missiles.modular.system.model.DeviceType;
import com.casic.missiles.modular.system.service.IDeviceTypeService;
import org.springframework.stereotype.Service;

import java.io.Serializable;

/**
 * <p>
 * 设备类型表 服务实现类
 * </p>
 *
 * @author lwh123
 * @since 2019-05-23
 */
@Service
public class DeviceTypeServiceImpl extends ServiceImpl<DeviceTypeMapper, DeviceType> implements IDeviceTypeService {

    @Override
    public DeviceType selectDeviceTypeByName(String typeName) {
        QueryWrapper<DeviceType> query = new QueryWrapper();
        query.eq("TYPE_NAME",typeName);
        return this.baseMapper.selectOne(query);
    }

    @Override
    public int countDeviceByType(Serializable typeId) {
        return this.baseMapper.countDeviceByType(typeId);
    }

}
