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.Warning2Mapper;
import com.gyee.frame.model.auto.Warning2;
import com.gyee.frame.model.auto.Warning2Example;
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 Warning2Service implements BaseService<Warning2, Warning2Example> {
	@Autowired
	private Warning2Mapper warning2Mapper;
	

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

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

	
	@Override
	public int updateByExample(Warning2 record, Warning2Example example) {
		
		return warning2Mapper.updateByExample(record, example);
	}

	@Override
	public List<Warning2> selectByExample(Warning2Example example) {
		
		return warning2Mapper.selectByExample(example);
	}

	
	@Override
	public long countByExample(Warning2Example example) {
		
		return warning2Mapper.countByExample(example);
	}

	
	@Override
	public int deleteByExample(Warning2Example example) {
		
		return warning2Mapper.deleteByExample(example);
	}
	

}
