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.Alertrule2Mapper;
import com.gyee.frame.model.auto.Alertrule2;
import com.gyee.frame.model.auto.Alertrule2Example;
import com.gyee.frame.util.SnowflakeIdWorker;
import org.springframework.stereotype.Service;

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


@Service
public class Alertrule2ervice implements BaseService<Alertrule2, Alertrule2Example> {
	@Resource
	private Alertrule2Mapper alertrule2Mapper;
	

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

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

	
	@Override
	public int updateByExample(Alertrule2 record, Alertrule2Example example) {
		
		return alertrule2Mapper.updateByExample(record, example);
	}

	@Override
	public List<Alertrule2> selectByExample(Alertrule2Example example) {
		
		return alertrule2Mapper.selectByExample(example);
	}

	
	@Override
	public long countByExample(Alertrule2Example example) {
		
		return alertrule2Mapper.countByExample(example);
	}

	
	@Override
	public int deleteByExample(Alertrule2Example example) {
		
		return alertrule2Mapper.deleteByExample(example);
	}
	

}
