TbE2eCrmOrderDao.java 2.71 KB
package com.sitech.ismp.coll.busi.e2e.dao;

import java.sql.SQLException;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.sitech.ismp.coll.busi.e2e.domain.TbE2eCrmOrder;

public class TbE2eCrmOrderDao extends OracleBaseDao {

	public TbE2eCrmOrderDao(Map<String, String> params) {
		super(params);
	}

	@SuppressWarnings("unchecked")
	public List<TbE2eCrmOrder> selectTbE2eCrmOrder(String propName,
			String propValue, Date fileTime) {
		HashMap<String, Object> map = new HashMap<String, Object>();
		map.put("PROP_NAME", "%" + propName + "%");
		map.put("PROP_VALUE", "%" + propValue + "%");
		map.put("FILE_TIME", fileTime);
		map.put("DATA_TYPE", "属性");
		map.put("CRM_ROW_STATUS", "新建");
		map.put("CRM_ROW_STATUS1", "已提交");		
		map.put("OPER_TYPE", "新建");
		map.put("CLIENT_TYPE", "%政企%");
		
		try {
			return sqlmapClient.queryForList("selectTbE2eCrmOrder", map);
		} catch (SQLException e) {
			error.error("Exception while selectTbE2eCrmOrder", e);
			return null;
		}
	}
	

	@SuppressWarnings("unchecked")
	public List<TbE2eCrmOrder> selectDiffCrmOrder(Date fileTime) {
		HashMap<String, Object> map = new HashMap<String, Object>();
		map.put("FILE_TIME", fileTime);
		map.put("CRM_ROW_STATUS", "已提交");
		map.put("ORDER_STATUS", "已提交%");
		try {
			return sqlmapClient.queryForList("selectDiffCrmOrder", map);
		} catch (SQLException e) {
			error.error("Exception while selectDiffCrmOrder", e);
			return null;
		}
	}

	@SuppressWarnings("unchecked")
	public List<TbE2eCrmOrder> selectTbE2eCrmOrderSpec(String crmOrderId, String crmVersion,String propName,
			String propValue, Date fileTime) {
		HashMap<String, Object> map = new HashMap<String, Object>();
		map.put("PROP_NAME", propName);
		map.put("PROP_VALUE", propValue);
		map.put("FILE_TIME", fileTime);	
		map.put("DATA_TYPE", "属性");
		map.put("CRM_ORDER_ID", crmOrderId);
		map.put("VERSION_NUM", crmVersion);
		
		try {
			return sqlmapClient.queryForList("selectTbE2eCrmOrderSpec", map);
		} catch (SQLException e) {
			error.error("Exception while selectTbE2eCrmOrderSpec", e);
			return null;
		}
	}

	public boolean isFTTH(String rowId) {
		HashMap<String, Object> map = new HashMap<String, Object>();
		map.put("ROW_ID", rowId);
		map.put("PROP_NAME", "接入方式");
		map.put("PROP_VALUE", "FTTH");

		Integer count = -1;
		try {
			count = (Integer) sqlmapClient.queryForObject("isFTTH", map);
		} catch (SQLException e) {
			error.error("Exception while selectTbE2eCrmOrderSpec", e);
			count = -1;
		}
		if (count > 0) {
			return true;
		}
		return false;
	}

	/**
	 * 查询政企订单
	 * @param fileTime
	 */
	public List<TbE2eCrmOrder> selectGEOrder(Date fileTime) {
		
		return null;
	}
}