package nccloud.impl.pu.query;

import nc.bs.dao.BaseDAO;
import nc.bs.dao.DAOException;
import nc.bs.framework.json.core.exception.BusinessException;
import nc.itf.pu.query.IQuery;
import nc.jdbc.framework.SQLParameter;
import nc.jdbc.framework.processor.ColumnProcessor;

public class QueryImpl implements IQuery{
	private BaseDAO baseDao = new BaseDAO();
	@Override
	public String[] queryCostregion(String... pk_orgs) throws BusinessException, DAOException  {
		// TODO Auto-generated method stub
		String[] rtnValue = new String[pk_orgs.length];
		Integer i = 0;
		for(String pk_org : pk_orgs) {
			String sql = "select pk_costregion from org_costregion where pk_org = ?";
			SQLParameter param = new SQLParameter();
			param.addParam(pk_org);
			String result = (String) baseDao.executeQuery(sql,param, new ColumnProcessor());
			rtnValue[i] = result;
			i++;
		}
		
		
		return rtnValue;
	}

}
