package com.gyee.frame.service;

import com.gyee.frame.common.base.BaseService;
import com.gyee.frame.common.support.Convert;
import com.gyee.frame.mapper.auto.EquipmentmodelMapper;
import com.gyee.frame.model.auto.Equipmentmodel;
import com.gyee.frame.model.auto.EquipmentmodelExample;
import com.gyee.frame.util.SnowflakeIdWorker;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class EquipmentmodelService implements BaseService<Equipmentmodel, EquipmentmodelExample> {
	@Resource
	private EquipmentmodelMapper equipmentmodelMapper;
	

	@Override
	public int deleteByPrimaryKey(String ids) {
				
			List<String> lista=Convert.toListStrArray(ids);
			EquipmentmodelExample example=new EquipmentmodelExample();
			example.createCriteria().andIdIn(lista);
			return equipmentmodelMapper.deleteByExample(example);
			
				
	}
	
	
	@Override
	public Equipmentmodel selectByPrimaryKey(String id) {
				
			return equipmentmodelMapper.selectByPrimaryKey(id);
				
	}

	
	@Override
	public int updateByPrimaryKeySelective(Equipmentmodel record) {
		return equipmentmodelMapper.updateByPrimaryKeySelective(record);
	}
	
	
	/**
	 * 添加
	 */
	@Override
	public int insertSelective(Equipmentmodel record) {
				
		//添加雪花主键id
		record.setId(SnowflakeIdWorker.getUUID());
			
				
		return equipmentmodelMapper.insertSelective(record);
	}
	
	
	@Override
	public int updateByExampleSelective(Equipmentmodel record, EquipmentmodelExample example) {
		
		return equipmentmodelMapper.updateByExampleSelective(record, example);
	}

	
	@Override
	public int updateByExample(Equipmentmodel record, EquipmentmodelExample example) {
		
		return equipmentmodelMapper.updateByExample(record, example);
	}

	@Override
	public List<Equipmentmodel> selectByExample(EquipmentmodelExample example) {
		
		return equipmentmodelMapper.selectByExample(example);
	}

	
	@Override
	public long countByExample(EquipmentmodelExample example) {
		
		return equipmentmodelMapper.countByExample(example);
	}

	
	@Override
	public int deleteByExample(EquipmentmodelExample example) {
		
		return equipmentmodelMapper.deleteByExample(example);
	}
	

}
