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.ModelPowerMapper;
import com.gyee.frame.model.auto.ModelPower;
import com.gyee.frame.model.auto.ModelPowerExample;
import com.gyee.frame.util.SnowflakeIdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class ModelPowerService implements BaseService<ModelPower, ModelPowerExample> {
	@Autowired
	private ModelPowerMapper modelPowerMapper;
	

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

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

	
	@Override
	public int updateByExample(ModelPower record, ModelPowerExample example) {
		
		return modelPowerMapper.updateByExample(record, example);
	}

	@Override
	public List<ModelPower> selectByExample(ModelPowerExample example) {
		
		return modelPowerMapper.selectByExample(example);
	}

	
	@Override
	public long countByExample(ModelPowerExample example) {
		
		return modelPowerMapper.countByExample(example);
	}

	
	@Override
	public int deleteByExample(ModelPowerExample example) {
		
		return modelPowerMapper.deleteByExample(example);
	}
	

}
