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.StoptypeMapper;
import com.gyee.frame.model.auto.Stoptype;
import com.gyee.frame.model.auto.StoptypeExample;
import com.gyee.frame.util.SnowflakeIdWorker;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class StoptypeService implements BaseService<Stoptype, StoptypeExample> {
	@Resource
	private StoptypeMapper stoptypeMapper;
	

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

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

	
	@Override
	public int updateByExample(Stoptype record, StoptypeExample example) {
		
		return stoptypeMapper.updateByExample(record, example);
	}

	@Override
	public List<Stoptype> selectByExample(StoptypeExample example) {
		
		return stoptypeMapper.selectByExample(example);
	}

	
	@Override
	public long countByExample(StoptypeExample example) {
		
		return stoptypeMapper.countByExample(example);
	}

	
	@Override
	public int deleteByExample(StoptypeExample example) {
		
		return stoptypeMapper.deleteByExample(example);
	}
	

}
