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.WindturbinepoweryawMapper;
import com.gyee.frame.model.auto.Windturbinepoweryaw;
import com.gyee.frame.model.auto.WindturbinepoweryawExample;
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 WindturbinepoweryawService implements BaseService<Windturbinepoweryaw, WindturbinepoweryawExample> {
	@Resource
	private WindturbinepoweryawMapper windturbinepoweryawMapper;
	

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

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

			
				
		return windturbinepoweryawMapper.insertSelective(record);
	}
	
	
	@Override
	public int updateByExampleSelective(Windturbinepoweryaw record, WindturbinepoweryawExample example) {
		
		return windturbinepoweryawMapper.updateByExampleSelective(record, example);
	}

	
	@Override
	public int updateByExample(Windturbinepoweryaw record, WindturbinepoweryawExample example) {
		
		return windturbinepoweryawMapper.updateByExample(record, example);
	}

	@Override
	public List<Windturbinepoweryaw> selectByExample(WindturbinepoweryawExample example) {
		
		return windturbinepoweryawMapper.selectByExample(example);
	}

	
	@Override
	public long countByExample(WindturbinepoweryawExample example) {
		
		return windturbinepoweryawMapper.countByExample(example);
	}

	
	@Override
	public int deleteByExample(WindturbinepoweryawExample example) {
		
		return windturbinepoweryawMapper.deleteByExample(example);
	}


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

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

	public List<YawValuesVo> getYawValuesTotalAll(String wtId, Date beginDate, Date endDate)
	{
		return windturbinepoweryawMapper.getYawTotalAll(wtId, beginDate, endDate);
	}
//	public List<Windturbinepoweryaw> findWindturbinepoweryaw(Date beginDate,Date endDate,String wpId) {
//
//		List<Windturbinepoweryaw> list=new ArrayList<>();
//
//		if (StringUtils.notEmp(wpId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
//
//			WindturbinepoweryawExample example=new WindturbinepoweryawExample();
//			example.setOrderByClause("recodedata DESC");
//
//			WindturbinepoweryawExample.Criteria criteria =example.createCriteria();
//
//			criteria.andRecodedataGreaterThanOrEqualTo(beginDate).andRecodedataLessThan(endDate);
//
//			criteria.andWindpowerstationidEqualTo(wpId);
//			criteria.andWindpowerstationidLike("%FDC");
//			list= windturbinepoweryawMapper.selectByExample(example);
//
//		}
//		return list;
//
//	}

}
