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.WindpowerstationthewindinfoMapper;
import com.gyee.frame.model.auto.Windpowerstationthewindinfo;
import com.gyee.frame.model.auto.WindpowerstationthewindinfoExample;
import com.gyee.frame.model.custom.ValueVo;
import com.gyee.frame.util.DateUtils;
import com.gyee.frame.util.StringUtils;
import org.springframework.stereotype.Service;

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


@Service
public class WindpowerstationthewindinfoService implements BaseService<Windpowerstationthewindinfo, WindpowerstationthewindinfoExample> {
	@Resource
	private WindpowerstationthewindinfoMapper windpowerstationthewindinfoMapper;
	private String jfplday;
	private String jfplmonth;
	private String jfplyear;
	@Override
	public int deleteByPrimaryKey(String ids) {
				
			List<Integer> lista=Convert.toIntArrayList(ids);
			WindpowerstationthewindinfoExample example=new WindpowerstationthewindinfoExample();
			example.createCriteria().andIdIn(lista);
			return windpowerstationthewindinfoMapper.deleteByExample(example);
			
				
	}
	

	@Override
	public Windpowerstationthewindinfo selectByPrimaryKey(String id) {

			return windpowerstationthewindinfoMapper.selectByPrimaryKey(Integer.valueOf(id));

	}


	@Override
	public int updateByPrimaryKeySelective(Windpowerstationthewindinfo record) {
		return windpowerstationthewindinfoMapper.updateByPrimaryKeySelective(record);
	}

	
	/**
	 * 添加
	 */
	@Override
	public int insertSelective(Windpowerstationthewindinfo record) {
				

				
		return windpowerstationthewindinfoMapper.insertSelective(record);
	}
	
	
	@Override
	public int updateByExampleSelective(Windpowerstationthewindinfo record, WindpowerstationthewindinfoExample example) {
		
		return windpowerstationthewindinfoMapper.updateByExampleSelective(record, example);
	}

	
	@Override
	public int updateByExample(Windpowerstationthewindinfo record, WindpowerstationthewindinfoExample example) {
		
		return windpowerstationthewindinfoMapper.updateByExample(record, example);
	}

	@Override
	public List<Windpowerstationthewindinfo> selectByExample(WindpowerstationthewindinfoExample example) {
		
		return windpowerstationthewindinfoMapper.selectByExample(example);
	}

	
	@Override
	public long countByExample(WindpowerstationthewindinfoExample example) {
		
		return windpowerstationthewindinfoMapper.countByExample(example);
	}

	
	@Override
	public int deleteByExample(WindpowerstationthewindinfoExample example) {
		
		return windpowerstationthewindinfoMapper.deleteByExample(example);
	}

	public List<Windpowerstationthewindinfo> getWindpowerstationthewindinfo(String wpId,Date recorddate) {


		List<Windpowerstationthewindinfo> list = null;

		if (StringUtils.notEmp(wpId) && StringUtils.notEmp(recorddate)) {

			WindpowerstationthewindinfoExample example = new WindpowerstationthewindinfoExample();
			example.setOrderByClause("windpowerstationid asc");

			if (StringUtils.notEmp(wpId) && StringUtils.notEmp(recorddate)) {

				WindpowerstationthewindinfoExample.Criteria criteria =example.createCriteria();
				criteria.andWindpowerstationidEqualTo(wpId);


				Date endDate= DateUtils.addDays(recorddate,1);
				criteria.andRecorddateGreaterThanOrEqualTo(recorddate).andRecorddateLessThan(endDate);

				list = windpowerstationthewindinfoMapper.selectByExample(example);
			} else {
				list = new ArrayList<>();
			}

		}
		return list;

	}




	public Map<String, Object> wprfxpl(String wpId,String recorddate) {

		Map<String, Object> map = new HashMap<String, Object>();

		List<ValueVo> vos = new ArrayList<ValueVo>();

		if (StringUtils.notEmp(recorddate) && StringUtils.notEmp(wpId)) {

			Date date = DateUtils.parseDate(recorddate);
			List<Windpowerstationthewindinfo> wtdls = getWindpowerstationthewindinfo(wpId, date);

			if (!wtdls.isEmpty()) {

				Windpowerstationthewindinfo winfo = wtdls.get(0);
				int cb = (int) winfo.getCb().intValue();
				int cd = (int) winfo.getCd().intValue();
				int cg = (int) winfo.getCg().intValue();

				jfplday = "静风频率为" + cb;
				jfplmonth = "静风频率为" + cd;
				jfplyear = "静风频率为" + cg;
				for (int i = 0; i < 16; i++) {
					ValueVo vo = new ValueVo();
					double temp1=0.0;
					double temp2=0.0;
					double temp3=0.0;
					switch (i) {
						case 0:
							temp1=null !=winfo.getN4()?winfo.getN4():0.0;
							temp2=null !=winfo.getN()?winfo.getN():0.0;
							temp3=null !=winfo.getN4()?winfo.getN4():0.0;

							vo.setName("N (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 1:
							temp1=null !=winfo.getNne4()?winfo.getNne4():0.0;
							temp2=null !=winfo.getNne()?winfo.getNne():0.0;
							temp3=null !=winfo.getNne4()?winfo.getNne4():0.0;

							vo.setName("NNE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 2:
							temp1=null !=winfo.getNe4()?winfo.getNe4():0.0;
							temp2=null !=winfo.getNe()?winfo.getNe():0.0;
							temp3=null !=winfo.getNe4()?winfo.getNe4():0.0;

							vo.setName("NE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 3:
							temp1=null !=winfo.getEne4()?winfo.getEne4():0.0;
							temp2=null !=winfo.getEne()?winfo.getEne():0.0;
							temp3=null !=winfo.getEne4()?winfo.getEne4():0.0;

							vo.setName("ENE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);


							break;
						case 4:
							temp1=null !=winfo.getE4()?winfo.getE4():0.0;
							temp2=null !=winfo.getE()?winfo.getE():0.0;
							temp3=null !=winfo.getE4()?winfo.getE4():0.0;

							vo.setName("E (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 5:
							temp1=null !=winfo.getEse4()?winfo.getEse4():0.0;
							temp2=null !=winfo.getEse()?winfo.getEse():0.0;
							temp3=null !=winfo.getEse4()?winfo.getEse4():0.0;
							vo.setName("ESE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 6:
							temp1=null !=winfo.getSe4()?winfo.getSe4():0.0;
							temp2=null !=winfo.getSe()?winfo.getSe():0.0;
							temp3=null !=winfo.getSe4()?winfo.getSe4():0.0;

							vo.setName("SE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 7:
							temp1=null !=winfo.getSse4()?winfo.getSse4():0.0;
							temp2=null !=winfo.getSse()?winfo.getSse():0.0;
							temp3=null !=winfo.getSse4()?winfo.getSse4():0.0;
							vo.setName("SSE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 8:
							temp1=null !=winfo.getS4()?winfo.getS4():0.0;
							temp2=null !=winfo.getS()?winfo.getS():0.0;
							temp3=null !=winfo.getS4()?winfo.getS4():0.0;
							vo.setName("S (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 9:
							temp1=null !=winfo.getSsw4()?winfo.getSsw4():0.0;
							temp2=null !=winfo.getSsw()?winfo.getSsw():0.0;
							temp3=null !=winfo.getSsw4()?winfo.getSsw4():0.0;

							vo.setName("SSW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 10:
							temp1=null !=winfo.getSw4()?winfo.getSw4():0.0;
							temp2=null !=winfo.getSw()?winfo.getSw():0.0;
							temp3=null !=winfo.getSw4()?winfo.getSw4():0.0;

							vo.setName("SW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 11:
							temp1=null !=winfo.getWsw4()?winfo.getWsw4():0.0;
							temp2=null !=winfo.getWsw()?winfo.getWsw():0.0;
							temp3=null !=winfo.getWsw4()?winfo.getWsw4():0.0;

							vo.setName("WSW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 12:
							temp1=null !=winfo.getW4()?winfo.getW4():0.0;
							temp2=null !=winfo.getW()?winfo.getW():0.0;
							temp3=null !=winfo.getW4()?winfo.getW4():0.0;

							vo.setName("W (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 13:
							temp1=null !=winfo.getWnw4()?winfo.getWnw4():0.0;
							temp2=null !=winfo.getWnw()?winfo.getWnw():0.0;
							temp3=null !=winfo.getWnw4()?winfo.getWnw4():0.0;

							vo.setName("WNW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 14:
							temp1=null !=winfo.getNw4()?winfo.getNw4():0.0;
							temp2=null !=winfo.getNw()?winfo.getNw():0.0;
							temp3=null !=winfo.getNw4()?winfo.getNw4():0.0;

							vo.setName("NW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 15:
							temp1=null !=winfo.getNnw4()?winfo.getNnw4():0.0;
							temp2=null !=winfo.getNnw()?winfo.getNnw():0.0;
							temp3=null !=winfo.getNnw4()?winfo.getNnw4():0.0;

							vo.setName("NNW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;


						default:
							break;
					}

					vos.add(vo);

				}

			}

			map.put("jfpl", jfplday);
			map.put("data", vos);

		}
		return map;

	}


	public Map<String, Object> wpyfxpl(String wpId, String recorddate) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<ValueVo> vos = new ArrayList<ValueVo>();
		if (StringUtils.notEmp(recorddate) && StringUtils.notEmp(wpId)) {

			Date date = DateUtils.parseDate(recorddate);

			List<Windpowerstationthewindinfo> wtdls =getWindpowerstationthewindinfo(wpId, date);

			if (!wtdls.isEmpty()) {

				Windpowerstationthewindinfo winfo = wtdls.get(0);
				int cb = (int) winfo.getCb().intValue();
				int cd = (int) winfo.getCd().intValue();
				int cg = (int) winfo.getCg().intValue();

				jfplday = "静风频率为" + cb;
				jfplmonth = "静风频率为" + cd;
				jfplyear = "静风频率为" + cg;
				for (int i = 0; i < 16; i++) {
					ValueVo vo = new ValueVo();
					double temp1=0.0;
					double temp2=0.0;
					double temp3=0.0;
					switch (i) {
						case 0:
							temp1=null !=winfo.getN10()?winfo.getN10():0.0;
							temp2=null !=winfo.getN7()?winfo.getN7():0.0;
							temp3=null !=winfo.getN10()?winfo.getN10():0.0;

							vo.setName("N (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 1:
							temp1=null !=winfo.getNne10()?winfo.getNne10():0.0;
							temp2=null !=winfo.getNne7()?winfo.getNne7():0.0;
							temp3=null !=winfo.getNne10()?winfo.getNne10():0.0;

							vo.setName("NNE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 2:
							temp1=null !=winfo.getNe10()?winfo.getNe10():0.0;
							temp2=null !=winfo.getNe7()?winfo.getNe7():0.0;
							temp3=null !=winfo.getNe10()?winfo.getNe10():0.0;

							vo.setName("NE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 3:
							temp1=null !=winfo.getEne10()?winfo.getEne10():0.0;
							temp2=null !=winfo.getEne7()?winfo.getEne7():0.0;
							temp3=null !=winfo.getEne10()?winfo.getEne10():0.0;

							vo.setName("ENE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);


							break;
						case 4:
							temp1=null !=winfo.getE10()?winfo.getE10():0.0;
							temp2=null !=winfo.getE7()?winfo.getE7():0.0;
							temp3=null !=winfo.getE10()?winfo.getE10():0.0;

							vo.setName("E (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 5:
							temp1=null !=winfo.getEse10()?winfo.getEse10():0.0;
							temp2=null !=winfo.getEse7()?winfo.getEse7():0.0;
							temp3=null !=winfo.getEse10()?winfo.getEse10():0.0;
							vo.setName("ESE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 6:
							temp1=null !=winfo.getSe10()?winfo.getSe10():0.0;
							temp2=null !=winfo.getSe7()?winfo.getSe7():0.0;
							temp3=null !=winfo.getSe10()?winfo.getSe10():0.0;

							vo.setName("SE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 7:
							temp1=null !=winfo.getSse10()?winfo.getSse10():0.0;
							temp2=null !=winfo.getSse7()?winfo.getSse7():0.0;
							temp3=null !=winfo.getSse10()?winfo.getSse10():0.0;
							vo.setName("SSE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 8:
							temp1=null !=winfo.getS10()?winfo.getS10():0.0;
							temp2=null !=winfo.getS7()?winfo.getS7():0.0;
							temp3=null !=winfo.getS10()?winfo.getS10():0.0;
							vo.setName("S (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 9:
							temp1=null !=winfo.getSsw10()?winfo.getSsw10():0.0;
							temp2=null !=winfo.getSsw7()?winfo.getSsw7():0.0;
							temp3=null !=winfo.getSsw10()?winfo.getSsw10():0.0;

							vo.setName("SSW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 10:
							temp1=null !=winfo.getSw10()?winfo.getSw10():0.0;
							temp2=null !=winfo.getSw7()?winfo.getSw7():0.0;
							temp3=null !=winfo.getSw10()?winfo.getSw10():0.0;

							vo.setName("SW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 11:
							temp1=null !=winfo.getWsw10()?winfo.getWsw10():0.0;
							temp2=null !=winfo.getWsw7()?winfo.getWsw7():0.0;
							temp3=null !=winfo.getWsw10()?winfo.getWsw10():0.0;

							vo.setName("WSW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 12:
							temp1=null !=winfo.getW10()?winfo.getW10():0.0;
							temp2=null !=winfo.getW7()?winfo.getW7():0.0;
							temp3=null !=winfo.getW10()?winfo.getW10():0.0;

							vo.setName("W (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 13:
							temp1=null !=winfo.getWnw10()?winfo.getWnw10():0.0;
							temp2=null !=winfo.getWnw7()?winfo.getWnw7():0.0;
							temp3=null !=winfo.getWnw10()?winfo.getWnw10():0.0;

							vo.setName("WNW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 14:
							temp1=null !=winfo.getNw10()?winfo.getNw10():0.0;
							temp2=null !=winfo.getNw7()?winfo.getNw7():0.0;
							temp3=null !=winfo.getNw10()?winfo.getNw10():0.0;

							vo.setName("NW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 15:
							temp1=null !=winfo.getNnw10()?winfo.getNnw10():0.0;
							temp2=null !=winfo.getNnw7()?winfo.getNnw7():0.0;
							temp3=null !=winfo.getNnw10()?winfo.getNnw10():0.0;

							vo.setName("NNW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;


						default:
							break;
					}

					vos.add(vo);

				}

			}

			map.put("jfpl", jfplmonth);
			map.put("data", vos);

		}

		return map;
	}


	public Map<String, Object> wpnfxpl(String wpId, String recorddate) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<ValueVo> vos = new ArrayList<ValueVo>();
		if (StringUtils.notEmp(recorddate) && StringUtils.notEmp(wpId)) {

			Date date = DateUtils.parseDate(recorddate);
			List<Windpowerstationthewindinfo> wtdls = getWindpowerstationthewindinfo(wpId, date);

			if (!wtdls.isEmpty()) {

				Windpowerstationthewindinfo winfo = wtdls.get(0);
				int cb = (int) winfo.getCb().intValue();
				int cd = (int) winfo.getCd().intValue();
				int cg = (int) winfo.getCg().intValue();

				jfplday = "静风频率为" + cb;
				jfplmonth = "静风频率为" + cd;
				jfplyear = "静风频率为" + cg;
				for (int i = 0; i < 16; i++) {
					ValueVo vo = new ValueVo();
					double temp1=0.0;
					double temp2=0.0;
					double temp3=0.0;
					switch (i) {
						case 0:
							temp1=null !=winfo.getN16()?winfo.getN16():0.0;
							temp2=null !=winfo.getN13()?winfo.getN13():0.0;
							temp3=null !=winfo.getN16()?winfo.getN16():0.0;

							vo.setName("N (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 1:
							temp1=null !=winfo.getNne16()?winfo.getNne16():0.0;
							temp2=null !=winfo.getNne13()?winfo.getNne13():0.0;
							temp3=null !=winfo.getNne16()?winfo.getNne16():0.0;

							vo.setName("NNE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 2:
							temp1=null !=winfo.getNe16()?winfo.getNe16():0.0;
							temp2=null !=winfo.getNe13()?winfo.getNe13():0.0;
							temp3=null !=winfo.getNe16()?winfo.getNe16():0.0;

							vo.setName("NE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 3:
							temp1=null !=winfo.getEne16()?winfo.getEne16():0.0;
							temp2=null !=winfo.getEne13()?winfo.getEne13():0.0;
							temp3=null !=winfo.getEne16()?winfo.getEne16():0.0;

							vo.setName("ENE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);


							break;

						case 4:
							temp1=null !=winfo.getE16()?winfo.getE16():0.0;
							temp2=null !=winfo.getE13()?winfo.getE13():0.0;
							temp3=null !=winfo.getE16()?winfo.getE16():0.0;

							vo.setName("E (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 5:
							temp1=null !=winfo.getEse16()?winfo.getEse16():0.0;
							temp2=null !=winfo.getEse13()?winfo.getEse13():0.0;
							temp3=null !=winfo.getEse16()?winfo.getEse16():0.0;
							vo.setName("ESE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 6:
							temp1=null !=winfo.getSe16()?winfo.getSe16():0.0;
							temp2=null !=winfo.getSe13()?winfo.getSe13():0.0;
							temp3=null !=winfo.getSe16()?winfo.getSe16():0.0;

							vo.setName("SE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 7:
							temp1=null !=winfo.getSse16()?winfo.getSse16():0.0;
							temp2=null !=winfo.getSse13()?winfo.getSse13():0.0;
							temp3=null !=winfo.getSse16()?winfo.getSse16():0.0;
							vo.setName("SSE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 8:
							temp1=null !=winfo.getS16()?winfo.getS16():0.0;
							temp2=null !=winfo.getS13()?winfo.getS13():0.0;
							temp3=null !=winfo.getS16()?winfo.getS16():0.0;
							vo.setName("S (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 9:
							temp1=null !=winfo.getSsw16()?winfo.getSsw16():0.0;
							temp2=null !=winfo.getSsw13()?winfo.getSsw13():0.0;
							temp3=null !=winfo.getSsw16()?winfo.getSsw16():0.0;

							vo.setName("SSW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 10:
							temp1=null !=winfo.getSw16()?winfo.getSw16():0.0;
							temp2=null !=winfo.getSw13()?winfo.getSw13():0.0;
							temp3=null !=winfo.getSw16()?winfo.getSw16():0.0;

							vo.setName("SW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 11:
							temp1=null !=winfo.getWsw16()?winfo.getWsw16():0.0;
							temp2=null !=winfo.getWsw13()?winfo.getWsw13():0.0;
							temp3=null !=winfo.getWsw16()?winfo.getWsw16():0.0;

							vo.setName("WSW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 12:
							temp1=null !=winfo.getW16()?winfo.getW16():0.0;
							temp2=null !=winfo.getW13()?winfo.getW13():0.0;
							temp3=null !=winfo.getW16()?winfo.getW16():0.0;

							vo.setName("W (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 13:
							temp1=null !=winfo.getWnw16()?winfo.getWnw16():0.0;
							temp2=null !=winfo.getWnw13()?winfo.getWnw13():0.0;
							temp3=null !=winfo.getWnw16()?winfo.getWnw16():0.0;

							vo.setName("WNW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 14:
							temp1=null !=winfo.getNw16()?winfo.getNw16():0.0;
							temp2=null !=winfo.getNw13()?winfo.getNw13():0.0;
							temp3=null !=winfo.getNw16()?winfo.getNw16():0.0;

							vo.setName("NW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 15:
							temp1=null !=winfo.getNnw16()?winfo.getNnw16():0.0;
							temp2=null !=winfo.getNnw13()?winfo.getNnw13():0.0;
							temp3=null !=winfo.getNnw16()?winfo.getNnw16():0.0;

							vo.setName("NNW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;

						default:
							break;
					}

					vos.add(vo);

				}

			}

			map.put("jfpl", jfplyear);
			map.put("data", vos);

		}

		return map;
	}



	public Map<String, Object> wprzdfs(String wpId, String recorddate) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<ValueVo> vos = new ArrayList<ValueVo>();
		if (StringUtils.notEmp(recorddate) && StringUtils.notEmp(wpId)) {


			Date date = DateUtils.parseDate(recorddate);
			List<Windpowerstationthewindinfo> wtdls = getWindpowerstationthewindinfo(wpId, date);

			if (!wtdls.isEmpty()) {

				Windpowerstationthewindinfo winfo = wtdls.get(0);

				int cb = (int) winfo.getCb().intValue();
				int cd = (int) winfo.getCd().intValue();
				int cg = (int) winfo.getCg().intValue();

				jfplday = "静风频率为" + cb;
				jfplmonth = "静风频率为" + cd;
				jfplyear = "静风频率为" + cg;

				for (int i = 0; i < 16; i++) {
					ValueVo vo = new ValueVo();
					double temp1 = 0.0;
					double temp2 = 0.0;
					double temp3 = 0.0;
					switch (i) {
						case 0:
							temp1 = null != winfo.getN4() ? winfo.getN4() : 0.0;
							temp2 = null != winfo.getN() ? winfo.getN() : 0.0;
							temp3 = null != winfo.getN2() ? winfo.getN2() : 0.0;

							vo.setName("N (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
//						vo.setName("N(" + winfo.getN4() + "/" + winfo.getN() + ")");
//
//						vo.setData1(winfo.getN2());
							break;
						case 1:
							temp1 = null != winfo.getNne4() ? winfo.getNne4() : 0.0;
							temp2 = null != winfo.getNne() ? winfo.getNne() : 0.0;
							temp3 = null != winfo.getNne2() ? winfo.getNne2() : 0.0;

							vo.setName("NNE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
//						vo.setName("NNE(" + winfo.getNne4() + "/" + winfo.getNne() + ")");
//
//						vo.setData1(winfo.getNne2());
							break;
						case 2:
							temp1 = null != winfo.getNe4() ? winfo.getNe4() : 0.0;
							temp2 = null != winfo.getNe() ? winfo.getNe() : 0.0;
							temp3 = null != winfo.getNe2() ? winfo.getNe2() : 0.0;

							vo.setName("NE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
//						vo.setName("NE(" + winfo.getNe4() + "/" + winfo.getNe() + ")");
//
//						vo.setData1(winfo.getNe2());
							break;
						case 3:
							temp1 = null != winfo.getEne4() ? winfo.getEne4() : 0.0;
							temp2 = null != winfo.getEne() ? winfo.getEne() : 0.0;
							temp3 = null != winfo.getEne2() ? winfo.getEne2() : 0.0;

							vo.setName("ENE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
//						vo.setName("ENE(" + winfo.getEne4() + "/" + winfo.getEne() + ")");
//
//						vo.setData1(winfo.getEne2());

							break;
						case 4:
							temp1 = null != winfo.getE4() ? winfo.getE4() : 0.0;
							temp2 = null != winfo.getE() ? winfo.getE() : 0.0;
							temp3 = null != winfo.getE2() ? winfo.getE2() : 0.0;

							vo.setName("E (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							//vo.setName("E(" + winfo.getE4() + "/" + winfo.getE() + ")");


							break;
						case 5:
							temp1 = null != winfo.getEse4() ? winfo.getEse4() : 0.0;
							temp2 = null != winfo.getEse() ? winfo.getEse() : 0.0;
							temp3 = null != winfo.getEse2() ? winfo.getEse2() : 0.0;
							vo.setName("ESE (" + temp1 + "/" + temp2 + ")");
							//vo.setName("ESE(" + winfo.getEse4() + "/" + winfo.getEse() + ")");

							vo.setData1(temp3);
							break;
						case 6:
							temp1 = null != winfo.getSe4() ? winfo.getSe4() : 0.0;
							temp2 = null != winfo.getSe() ? winfo.getSe() : 0.0;
							temp3 = null != winfo.getSe2() ? winfo.getSe2() : 0.0;

							vo.setName("SE (" + temp1 + "/" + temp2 + ")");
							//vo.setName("SE(" + winfo.getSe4() + "/" + winfo.getSe() + ")");

							vo.setData1(temp3);
							break;
						case 7:
							temp1 = null != winfo.getSse4() ? winfo.getSse4() : 0.0;
							temp2 = null != winfo.getSse() ? winfo.getSse() : 0.0;
							temp3 = null != winfo.getSse2() ? winfo.getSse2() : 0.0;
							vo.setName("SSE (" + temp1 + "/" + temp2 + ")");
							//	vo.setName("SSE(" + winfo.getSse4() + "/" + winfo.getSse() + ")");

							vo.setData1(temp3);
							break;
						case 8:
							temp1 = null != winfo.getS4() ? winfo.getS4() : 0.0;
							temp2 = null != winfo.getS() ? winfo.getS() : 0.0;
							temp3 = null != winfo.getS2() ? winfo.getS2() : 0.0;
							vo.setName("S (" + temp1 + "/" + temp2 + ")");
							//vo.setName("S(" + winfo.getS4() + "/" + winfo.getS() + ")");

							vo.setData1(temp3);
							break;
						case 9:
							temp1 = null != winfo.getSsw4() ? winfo.getSsw4() : 0.0;
							temp2 = null != winfo.getSsw() ? winfo.getSsw() : 0.0;
							temp3 = null != winfo.getSsw2() ? winfo.getSsw2() : 0.0;

							vo.setName("SSW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

//						vo.setName("SSW(" + winfo.getSsw4() + "/" + winfo.getSsw() + ")");
//						vo.setData1(winfo.getSsw2());
							break;
						case 10:
							temp1 = null != winfo.getSw4() ? winfo.getSw4() : 0.0;
							temp2 = null != winfo.getSw() ? winfo.getSw() : 0.0;
							temp3 = null != winfo.getSw2() ? winfo.getSw2() : 0.0;

							vo.setName("SW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
//						vo.setName("SW(" + winfo.getSw4() + "/" + winfo.getSw() + ")");
//
//						vo.setData1(winfo.getSw2());
							break;
						case 11:
							temp1 = null != winfo.getWsw4() ? winfo.getWsw4() : 0.0;
							temp2 = null != winfo.getWsw() ? winfo.getWsw() : 0.0;
							temp3 = null != winfo.getWsw2() ? winfo.getWsw2() : 0.0;

							vo.setName("WSW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

//						vo.setName("WSW(" + winfo.getWsw4() + "/" + winfo.getWsw() + ")");
//
//						vo.setData1(winfo.getWsw2());

							break;
						case 12:
							temp1 = null != winfo.getW4() ? winfo.getW4() : 0.0;
							temp2 = null != winfo.getW() ? winfo.getW() : 0.0;
							temp3 = null != winfo.getW2() ? winfo.getW2() : 0.0;

							vo.setName("W (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
//						vo.setName("W(" + winfo.getW4() + "/" + winfo.getW() + ")");
//
//						vo.setData1(winfo.getW2());
							break;
						case 13:
							temp1 = null != winfo.getWnw4() ? winfo.getWnw4() : 0.0;
							temp2 = null != winfo.getWnw() ? winfo.getWnw() : 0.0;
							temp3 = null != winfo.getWnw2() ? winfo.getWnw2() : 0.0;

							vo.setName("WNW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
//						vo.setName("WNW(" + winfo.getWnw4() + "/" + winfo.getWnw() + ")");
//
//						vo.setData1(winfo.getWnw2());
							break;
						case 14:
							temp1 = null != winfo.getNw4() ? winfo.getNw4() : 0.0;
							temp2 = null != winfo.getNw() ? winfo.getNw() : 0.0;
							temp3 = null != winfo.getNw2() ? winfo.getNw2() : 0.0;

							vo.setName("NW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
//						vo.setName("NW(" + winfo.getNw4() + "/" + winfo.getNw() + ")");
//
//						vo.setData1(winfo.getNw2());
							break;
						case 15:
							temp1 = null != winfo.getNnw4() ? winfo.getNnw4() : 0.0;
							temp2 = null != winfo.getNnw() ? winfo.getNnw() : 0.0;
							temp3 = null != winfo.getNnw2() ? winfo.getNnw2() : 0.0;

							vo.setName("NNW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
//						vo.setName("NNW(" + winfo.getNnw4() + "/" + winfo.getNnw() + ")");
//
//						vo.setData1(winfo.getNnw2());
							break;


						default:
							break;
					}

					vos.add(vo);

				}

			}

		}

		map.put("jfpl", jfplday);
		map.put("data", vos);

		return map;
	}


	public Map<String, Object> wpyzdfs(String wpId, String recorddate) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<ValueVo> vos = new ArrayList<ValueVo>();
		if (StringUtils.notEmp(recorddate) && StringUtils.notEmp(wpId)) {

			Date date = DateUtils.parseDate(recorddate);
			List<Windpowerstationthewindinfo> wtdls =getWindpowerstationthewindinfo(wpId, date);

			if (!wtdls.isEmpty()) {

				Windpowerstationthewindinfo winfo = wtdls.get(0);
				int cb = (int) winfo.getCb().intValue();
				int cd = (int) winfo.getCd().intValue();
				int cg = (int) winfo.getCg().intValue();

				jfplday = "静风频率为" + cb;
				jfplmonth = "静风频率为" + cd;
				jfplyear = "静风频率为" + cg;
				for (int i = 0; i < 16; i++) {
					ValueVo vo = new ValueVo();
					double temp1 = 0.0;
					double temp2 = 0.0;
					double temp3 = 0.0;
					switch (i) {
						case 0:
							temp1 = null != winfo.getN10() ? winfo.getN10() : 0.0;
							temp2 = null != winfo.getN7() ? winfo.getN7() : 0.0;
							temp3 = null != winfo.getN8() ? winfo.getN8() : 0.0;

							vo.setName("N (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 1:
							temp1 = null != winfo.getNne10() ? winfo.getNne10() : 0.0;
							temp2 = null != winfo.getNne7() ? winfo.getNne7() : 0.0;
							temp3 = null != winfo.getNne8() ? winfo.getNne8() : 0.0;

							vo.setName("NNE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 2:
							temp1 = null != winfo.getNe10() ? winfo.getNe10() : 0.0;
							temp2 = null != winfo.getNe7() ? winfo.getNe7() : 0.0;
							temp3 = null != winfo.getNe8() ? winfo.getNe8() : 0.0;

							vo.setName("NE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 3:
							temp1 = null != winfo.getEne10() ? winfo.getEne10() : 0.0;
							temp2 = null != winfo.getEne7() ? winfo.getEne7() : 0.0;
							temp3 = null != winfo.getEne8() ? winfo.getEne8() : 0.0;

							vo.setName("ENE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);


							break;
						case 4:
							temp1 = null != winfo.getE10() ? winfo.getE10() : 0.0;
							temp2 = null != winfo.getE7() ? winfo.getE7() : 0.0;
							temp3 = null != winfo.getE8() ? winfo.getE8() : 0.0;

							vo.setName("E (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 5:
							temp1 = null != winfo.getEse10() ? winfo.getEse10() : 0.0;
							temp2 = null != winfo.getEse7() ? winfo.getEse7() : 0.0;
							temp3 = null != winfo.getEse8() ? winfo.getEse8() : 0.0;
							vo.setName("ESE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 6:
							temp1 = null != winfo.getSe10() ? winfo.getSe10() : 0.0;
							temp2 = null != winfo.getSe7() ? winfo.getSe7() : 0.0;
							temp3 = null != winfo.getSe8() ? winfo.getSe8() : 0.0;

							vo.setName("SE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 7:
							temp1 = null != winfo.getSse10() ? winfo.getSse10() : 0.0;
							temp2 = null != winfo.getSse7() ? winfo.getSse7() : 0.0;
							temp3 = null != winfo.getSse8() ? winfo.getSse8() : 0.0;
							vo.setName("SSE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 8:
							temp1 = null != winfo.getS10() ? winfo.getS10() : 0.0;
							temp2 = null != winfo.getS7() ? winfo.getS7() : 0.0;
							temp3 = null != winfo.getS8() ? winfo.getS8() : 0.0;
							vo.setName("S (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 9:
							temp1 = null != winfo.getSsw10() ? winfo.getSsw10() : 0.0;
							temp2 = null != winfo.getSsw7() ? winfo.getSsw7() : 0.0;
							temp3 = null != winfo.getSsw8() ? winfo.getSsw8() : 0.0;

							vo.setName("SSW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 10:
							temp1 = null != winfo.getSw10() ? winfo.getSw10() : 0.0;
							temp2 = null != winfo.getSw7() ? winfo.getSw7() : 0.0;
							temp3 = null != winfo.getSw8() ? winfo.getSw8() : 0.0;

							vo.setName("SW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 11:
							temp1 = null != winfo.getWsw10() ? winfo.getWsw10() : 0.0;
							temp2 = null != winfo.getWsw7() ? winfo.getWsw7() : 0.0;
							temp3 = null != winfo.getWsw8() ? winfo.getWsw8() : 0.0;

							vo.setName("WSW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 12:
							temp1 = null != winfo.getW10() ? winfo.getW10() : 0.0;
							temp2 = null != winfo.getW7() ? winfo.getW7() : 0.0;
							temp3 = null != winfo.getW8() ? winfo.getW8() : 0.0;

							vo.setName("W (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 13:
							temp1 = null != winfo.getWnw10() ? winfo.getWnw10() : 0.0;
							temp2 = null != winfo.getWnw7() ? winfo.getWnw7() : 0.0;
							temp3 = null != winfo.getWnw8() ? winfo.getWnw8() : 0.0;

							vo.setName("WNW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 14:
							temp1 = null != winfo.getNw10() ? winfo.getNw10() : 0.0;
							temp2 = null != winfo.getNw7() ? winfo.getNw7() : 0.0;
							temp3 = null != winfo.getNw8() ? winfo.getNw8() : 0.0;

							vo.setName("NW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 15:
							temp1 = null != winfo.getNnw10() ? winfo.getNnw10() : 0.0;
							temp2 = null != winfo.getNnw7() ? winfo.getNnw7() : 0.0;
							temp3 = null != winfo.getNnw8() ? winfo.getNnw8() : 0.0;

							vo.setName("NNW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						default:
							break;
					}
					vos.add(vo);
				}
			}

			map.put("jfpl", jfplmonth);
			map.put("data", vos);
		}
		return map;

	}


	public Map<String, Object> wpnzdfs(String wpId, String recorddate) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<ValueVo> vos = new ArrayList<ValueVo>();
		if (StringUtils.notEmp(recorddate) && StringUtils.notEmp(wpId)) {

			Date date = DateUtils.parseDate(recorddate);
			List<Windpowerstationthewindinfo> wtdls =getWindpowerstationthewindinfo(wpId, date);

			if (!wtdls.isEmpty()) {

				Windpowerstationthewindinfo winfo = wtdls.get(0);
				int cb = (int) winfo.getCb().intValue();
				int cd = (int) winfo.getCd().intValue();
				int cg = (int) winfo.getCg().intValue();

				jfplday = "静风频率为" + cb;
				jfplmonth = "静风频率为" + cd;
				jfplyear = "静风频率为" + cg;
				for (int i = 0; i < 16; i++) {
					ValueVo vo = new ValueVo();
					double temp1 = 0.0;
					double temp2 = 0.0;
					double temp3 = 0.0;
					switch (i) {
						case 0:
							temp1 = null != winfo.getN16() ? winfo.getN16() : 0.0;
							temp2 = null != winfo.getN13() ? winfo.getN13() : 0.0;
							temp3 = null != winfo.getN14() ? winfo.getN14() : 0.0;

							vo.setName("N (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 1:
							temp1 = null != winfo.getNne16() ? winfo.getNne16() : 0.0;
							temp2 = null != winfo.getNne13() ? winfo.getNne13() : 0.0;
							temp3 = null != winfo.getNne14() ? winfo.getNne14() : 0.0;

							vo.setName("NNE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 2:
							temp1 = null != winfo.getNe16() ? winfo.getNe16() : 0.0;
							temp2 = null != winfo.getNe13() ? winfo.getNe13() : 0.0;
							temp3 = null != winfo.getNe14() ? winfo.getNe14() : 0.0;

							vo.setName("NE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 3:
							temp1 = null != winfo.getEne16() ? winfo.getEne16() : 0.0;
							temp2 = null != winfo.getEne13() ? winfo.getEne13() : 0.0;
							temp3 = null != winfo.getEne14() ? winfo.getEne14() : 0.0;

							vo.setName("ENE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);


							break;
						case 4:
							temp1 = null != winfo.getE16() ? winfo.getE16() : 0.0;
							temp2 = null != winfo.getE13() ? winfo.getE13() : 0.0;
							temp3 = null != winfo.getE14() ? winfo.getE14() : 0.0;

							vo.setName("E (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 5:
							temp1 = null != winfo.getEse16() ? winfo.getEse16() : 0.0;
							temp2 = null != winfo.getEse13() ? winfo.getEse13() : 0.0;
							temp3 = null != winfo.getEse14() ? winfo.getEse14() : 0.0;
							vo.setName("ESE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 6:
							temp1 = null != winfo.getSe16() ? winfo.getSe16() : 0.0;
							temp2 = null != winfo.getSe13() ? winfo.getSe13() : 0.0;
							temp3 = null != winfo.getSe14() ? winfo.getSe14() : 0.0;

							vo.setName("SE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 7:
							temp1 = null != winfo.getSse16() ? winfo.getSse16() : 0.0;
							temp2 = null != winfo.getSse13() ? winfo.getSse13() : 0.0;
							temp3 = null != winfo.getSse14() ? winfo.getSse14() : 0.0;
							vo.setName("SSE (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 8:
							temp1 = null != winfo.getS16() ? winfo.getS16() : 0.0;
							temp2 = null != winfo.getS13() ? winfo.getS13() : 0.0;
							temp3 = null != winfo.getS14() ? winfo.getS14() : 0.0;
							vo.setName("S (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 9:
							temp1 = null != winfo.getSsw16() ? winfo.getSsw16() : 0.0;
							temp2 = null != winfo.getSsw13() ? winfo.getSsw13() : 0.0;
							temp3 = null != winfo.getSsw14() ? winfo.getSsw14() : 0.0;

							vo.setName("SSW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);
							break;
						case 10:
							temp1 = null != winfo.getSw16() ? winfo.getSw16() : 0.0;
							temp2 = null != winfo.getSw13() ? winfo.getSw13() : 0.0;
							temp3 = null != winfo.getSw14() ? winfo.getSw14() : 0.0;

							vo.setName("SW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 11:
							temp1 = null != winfo.getWsw16() ? winfo.getWsw16() : 0.0;
							temp2 = null != winfo.getWsw13() ? winfo.getWsw13() : 0.0;
							temp3 = null != winfo.getWsw14() ? winfo.getWsw14() : 0.0;

							vo.setName("WSW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 12:
							temp1 = null != winfo.getW16() ? winfo.getW16() : 0.0;
							temp2 = null != winfo.getW13() ? winfo.getW13() : 0.0;
							temp3 = null != winfo.getW14() ? winfo.getW14() : 0.0;

							vo.setName("W (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 13:
							temp1 = null != winfo.getWnw16() ? winfo.getWnw16() : 0.0;
							temp2 = null != winfo.getWnw13() ? winfo.getWnw13() : 0.0;
							temp3 = null != winfo.getWnw14() ? winfo.getWnw14() : 0.0;

							vo.setName("WNW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 14:
							temp1 = null != winfo.getNw16() ? winfo.getNw16() : 0.0;
							temp2 = null != winfo.getNw13() ? winfo.getNw13() : 0.0;
							temp3 = null != winfo.getNw14() ? winfo.getNw14() : 0.0;

							vo.setName("NW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;
						case 15:
							temp1 = null != winfo.getNnw16() ? winfo.getNnw16() : 0.0;
							temp2 = null != winfo.getNnw13() ? winfo.getNnw13() : 0.0;
							temp3 = null != winfo.getNnw14() ? winfo.getNnw14() : 0.0;

							vo.setName("NNW (" + temp1 + "/" + temp2 + ")");
							vo.setData1(temp3);

							break;


						default:
							break;
					}

					vos.add(vo);

				}

			}

			map.put("jfpl", jfplyear);
			map.put("data", vos);

		}

		return map;
	}
}
