package cn.com.countrygarden.bi.main.repository;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.sunshine.common.repository.DataRepositoryJDBC;

/**
 * 房屋状态表
 * 
 * @author huangzhengjun
 *
 */
@Repository("roomStateRepository")
public class RoomStateRepository extends DataRepositoryJDBC {
	protected final Logger log = LoggerFactory.getLogger(RoomStateRepository.class);

	public RoomStateRepository() {
		this.masterTable = "Tb_DeskTop_Resource_RoomState";// 表名
		// this.masterTablePK = "";// 表的主键

	}

	/**
	 * 查询房屋状态
	 * 
	 * @param paramMap
	 * @return
	 */
	public List<Map<String, Object>> queryRoomState(Map<String, Object> paramMap) {
		List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();
		String sql = "select statename,sum(roomnum) as sumroomnum,sum(roombuildarea) as sumarea from Tb_DeskTop_Resource_RoomState group by statename ";
		resultList = this.jdbcTemp.queryForList(sql);
		return resultList;
	}

}
