package test.repo;

import cn.com.countrygarden.bi.main.repository.ResourceRepository;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

//@RunWith(SpringJUnit4ClassRunner.class)
//@ContextConfiguration(locations = "classpath:/spring/applicationContext.xml")
public class ResourceRepoTest {

	@Autowired
	private ResourceRepository resourceRepository;

	/**
	 * 单元测试，查询资源主题的基础数据
	 */
	@Test
	public void testQueryResourceData() {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("organcode", null);
		paramMap.put("commid", "185301");
		List<Map<String, Object>> resourceDataList = resourceRepository.queryResourceData(paramMap);
		System.out.println("resourceDataList:" + resourceDataList.toString());
	}

	/**
	 * 单元测试,查询资源主题中的项目信息
	 */
	@Test
	public void testQueryProjectInfo() {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("organcode", null);
		paramMap.put("commid", "");
		List<Map<String, Object>> projectInfoList = resourceRepository.queryProjectInfo(paramMap);
		System.out.println("projectInfoList:" + projectInfoList.toString());
	}

	/**
	 * 单元测试，查询接管面积
	 */
	@Test
	public void testQueryTakeOverArea() {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("organcode", "0111");
		paramMap.put("commid", "");//185366

		List<Map<String, Object>> takeOverAreaList = resourceRepository.queryTakeOverArea(paramMap);
		System.out.println("takeOverAreaList:" + takeOverAreaList.toString());
	}
}
