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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class WarningService implements BaseService<Warning, WarningExample> {
	@Autowired
	private WarningMapper warningMapper;
	

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

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

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

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

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

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

}
