package com.chinacreator.process.dao;

import java.sql.SQLException;

import org.apache.commons.lang.math.NumberUtils;
import org.springframework.stereotype.Component;

import com.chinacreator.process.util.DataSource;
import com.frameworkset.common.poolman.SQLExecutor;

@Component
public class VacSyncOrderDao {

	public boolean canOrder(String province,String vacProductid) throws SQLException{
		String sql = "select count(1) from TD_VACSYNC_PROVINCE where status=0 and  province=? and canorder=1 and VACPRODUCTID=?";
		return NumberUtils.toLong(SQLExecutor.queryFieldWithDBName(DataSource.NET3G, sql,province,vacProductid))>0;
	}
	
	public static void main(String[] args) throws SQLException {
		VacSyncOrderDao dao = new VacSyncOrderDao();
		System.out.println(dao.canOrder("", "8000650900"));
	}
	
}
