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.P3TaskMapper;
import com.gyee.frame.model.auto.P3Task;
import com.gyee.frame.model.auto.P3TaskExample;
import com.gyee.frame.util.SnowflakeIdWorker;
import org.springframework.stereotype.Service;

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


@Service
public class P3TaskService implements BaseService<P3Task, P3TaskExample> {
	@Resource
	private P3TaskMapper p3TaskMapper;
	

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

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

	
	@Override
	public int updateByExample(P3Task record, P3TaskExample example) {
		
		return p3TaskMapper.updateByExample(record, example);
	}

	@Override
	public List<P3Task> selectByExample(P3TaskExample example) {
		
		return p3TaskMapper.selectByExample(example);
	}

	
	@Override
	public long countByExample(P3TaskExample example) {
		
		return p3TaskMapper.countByExample(example);
	}

	
	@Override
	public int deleteByExample(P3TaskExample example) {
		
		return p3TaskMapper.deleteByExample(example);
	}



}
