package test.repo;

import cn.com.countrygarden.bi.main.repository.ManageTopicRepository;
import com.microsoft.sqlserver.jdbc.SQLServerException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.CannotGetJdbcConnectionException;
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;

/**
 * 经营主题的单元测试类
 * 
 * @author huangzhengjun
 *
 */
//@RunWith(SpringJUnit4ClassRunner.class)
//@ContextConfiguration(locations = "classpath:/spring/applicationContext.xml")
public class ManageTopicRepoTest {

	@Autowired
	private ManageTopicRepository manageTopicRepository;

	/**
	 * 测试查询经营主题的基础数据
	 */
	@Test
	public void testQueryManageTopicCommData() {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("organcode", "0101");
		// paramMap.put("commid", "185301");
		List<Map<String, Object>> manageTopicCommDataList = manageTopicRepository.queryManageTopicCommData(paramMap);
		System.out.println("manageTopicCommDataList:" + manageTopicCommDataList.toString());
	}

	/**
	 * 测试查询资源主题的本日实收，昨日追缴，昨日车位收入
	 */
	@Test
	public void testQueryBrssZrzjZrcwsrData() {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("organcode", "");
		paramMap.put("commid", "");
		List<Map<String, Object>> brssZrzjZrcwsrDataList = null;
		try {
			brssZrzjZrcwsrDataList = manageTopicRepository.queryBrssZrzjZrcwsrData(paramMap);
		} catch (CannotGetJdbcConnectionException | SQLServerException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		System.out.println("brssZrzjZrcwsrDataList:" + brssZrzjZrcwsrDataList.toString());
	}

	@Test
	public void testQueryMultiRate() {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("organcode", "0101");
		paramMap.put("commid", "");
		List<Map<String, Object>> multiRateList = manageTopicRepository.queryMultiRate(paramMap);
		System.out.println("multiRateList:" + multiRateList.toString());
	}
}
