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.WindturbinewindyawMapper;
import com.gyee.frame.model.auto.Windturbinewindyaw;
import com.gyee.frame.model.auto.WindturbinewindyawExample;
import com.gyee.frame.model.custom.YawValuesVo;
import com.gyee.frame.model.custom.YawVo;
import org.springframework.stereotype.Service;

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


@Service
public class WindturbinewindyawService implements BaseService<Windturbinewindyaw, WindturbinewindyawExample> {
	@Resource
	private WindturbinewindyawMapper windturbinewindyawMapper;
	

	@Override
	public int deleteByPrimaryKey(String ids) {
				
			List<Integer> lista=Convert.toIntArrayList(ids);
			WindturbinewindyawExample example=new WindturbinewindyawExample();
			example.createCriteria().andIdIn(lista);
			return windturbinewindyawMapper.deleteByExample(example);
			
				
	}
	
	
	@Override
	public Windturbinewindyaw selectByPrimaryKey(String id) {
				
			return windturbinewindyawMapper.selectByPrimaryKey(Integer.valueOf(id));
				
	}

	
	@Override
	public int updateByPrimaryKeySelective(Windturbinewindyaw record) {
		return windturbinewindyawMapper.updateByPrimaryKeySelective(record);
	}
	
	
	/**
	 * 添加
	 */
	@Override
	public int insertSelective(Windturbinewindyaw record) {

			
				
		return windturbinewindyawMapper.insertSelective(record);
	}
	
	
	@Override
	public int updateByExampleSelective(Windturbinewindyaw record, WindturbinewindyawExample example) {
		
		return windturbinewindyawMapper.updateByExampleSelective(record, example);
	}

	
	@Override
	public int updateByExample(Windturbinewindyaw record, WindturbinewindyawExample example) {
		
		return windturbinewindyawMapper.updateByExample(record, example);
	}

	@Override
	public List<Windturbinewindyaw> selectByExample(WindturbinewindyawExample example) {
		
		return windturbinewindyawMapper.selectByExample(example);
	}

	
	@Override
	public long countByExample(WindturbinewindyawExample example) {
		
		return windturbinewindyawMapper.countByExample(example);
	}

	
	@Override
	public int deleteByExample(WindturbinewindyawExample example) {
		
		return windturbinewindyawMapper.deleteByExample(example);
	}


	public List<YawVo> getYawTotal(String wtId, Date beginDate, Date endDate)
	{
		return windturbinewindyawMapper.getYawTotal(wtId, beginDate, endDate);
	}

	public List<YawValuesVo> getYawValuesTotal(String wtId, Date beginDate, Date endDate, Integer value)
	{
		return windturbinewindyawMapper.getYawValuesTotal(wtId, beginDate, endDate,value);
	}

	public List<YawValuesVo> getYawValuesTotalAll(String wtId, Date beginDate, Date endDate)
	{
		return windturbinewindyawMapper.getYawTotalAll(wtId, beginDate, endDate);
	}
}
