9504167ae828a2ab66ae65d27ef75c28aea7a4a9.svn-base 966 B

12345678910111213141516171819202122232425262728
  1. package com.chinacreator.process.dao;
  2. import java.sql.SQLException;
  3. import org.apache.commons.lang.math.NumberUtils;
  4. import org.springframework.stereotype.Component;
  5. import com.chinacreator.process.util.DataSource;
  6. import com.frameworkset.common.poolman.SQLExecutor;
  7. @Component
  8. public class BlackWhiteDao {
  9. public boolean isWhite(String userid) throws SQLException{
  10. String sql = "select count(1) from td_activity_white where userid = ?";
  11. return NumberUtils.toInt(SQLExecutor.queryFieldWithDBName(DataSource.NET3G,sql,userid))>0;
  12. }
  13. public boolean isWhite(String userid,String cpid,String spid) throws SQLException{
  14. String sql = "select count(1) from td_activity_white where userid = ? and cpid = ? and spid = ?";
  15. return NumberUtils.toInt(SQLExecutor.queryFieldWithDBName(DataSource.NET3G,sql,userid))>0;
  16. }
  17. public static void main(String[] args) throws SQLException {
  18. BlackWhiteDao dao = new BlackWhiteDao();
  19. dao.isWhite("18574414678");
  20. }
  21. }