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.WindTurbineTestingPointaiyjMapper;
import com.gyee.frame.model.auto.WindTurbineTestingPointaiyj;
import com.gyee.frame.model.auto.WindTurbineTestingPointaiyjExample;
import com.gyee.frame.util.SnowflakeIdWorker;
import org.springframework.stereotype.Service;

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


@Service
public class WindTurbineTestingPointaiyjService implements BaseService<WindTurbineTestingPointaiyj, WindTurbineTestingPointaiyjExample> {
	@Resource
	private WindTurbineTestingPointaiyjMapper windTurbineTestingPointaiyjMapper;


	@Override
	public int deleteByPrimaryKey(String ids) {
				
			List<String> lista=Convert.toListStrArray(ids);
			WindTurbineTestingPointaiyjExample example=new WindTurbineTestingPointaiyjExample();
			example.createCriteria().andIdIn(lista);
			return windTurbineTestingPointaiyjMapper.deleteByExample(example);
			
				
	}

	@Override
	public WindTurbineTestingPointaiyj selectByPrimaryKey(String id) {
		return null;
	}

	@Override
	public int updateByPrimaryKeySelective(WindTurbineTestingPointaiyj record) {
		return 0;
	}

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

	
	@Override
	public int updateByExample(WindTurbineTestingPointaiyj record, WindTurbineTestingPointaiyjExample example) {
		
		return windTurbineTestingPointaiyjMapper.updateByExample(record, example);
	}

	@Override
	public List<WindTurbineTestingPointaiyj> selectByExample(WindTurbineTestingPointaiyjExample example) {
		
		return windTurbineTestingPointaiyjMapper.selectByExample(example);
	}

	
	@Override
	public long countByExample(WindTurbineTestingPointaiyjExample example) {
		
		return windTurbineTestingPointaiyjMapper.countByExample(example);
	}

	
	@Override
	public int deleteByExample(WindTurbineTestingPointaiyjExample example) {
		
		return windTurbineTestingPointaiyjMapper.deleteByExample(example);
	}



	public List<WindTurbineTestingPointaiyj> findAll()  {


		List<WindTurbineTestingPointaiyj> list =new ArrayList<>();
		WindTurbineTestingPointaiyjExample example=new WindTurbineTestingPointaiyjExample();

		list= windTurbineTestingPointaiyjMapper.selectByExample(example);

		return list;

	}




}
