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.WarningMapper;
import com.gyee.frame.model.auto.Warning;
import com.gyee.frame.model.auto.WarningExample;
import com.gyee.frame.util.SnowflakeIdWorker;
import org.springframework.stereotype.Service;

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


@Service
public class Warning2Service implements BaseService<Warning, WarningExample> {
	@Resource
	private WarningMapper warning2Mapper;
	

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

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

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

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

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

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

}
