package fr.zng.xxzx.common.dao.impl;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import fr.zng.xxzx.common.dao.CityWeatherDao;
import fr.zng.xxzx.common.dao.base.BaseDao;

public class CityWeatherDaoImpl extends BaseDao implements CityWeatherDao {

	@Override
	public List<String> getCityWeather() {
		List<HashMap> result = new ArrayList<HashMap>();
		List<String> list = new ArrayList<String>();
		try {
			makeSession();
			result = session.selectList("Pdt.getCityId");
			for(int i=0; i<result.size();i++){
				HashMap  hashMap = result.get(i);
				System.out.println(hashMap.get("weatherLocal"));

				list.add(hashMap.get("weatherLocal")+"");
			}
			session.commit();
		} catch (Exception e) {
			session.rollback();
			e.printStackTrace();
		} finally {
			close();
		}
		return list;
	}

	
}
