796ffa312f5617808b5a230cc00f2d39e323f174.svn-base 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package com.chinacreator.videoalliance.query.dao;
  2. import com.chinacreator.common.dao.ExecutorDao;
  3. import com.chinacreator.videoalliance.common.util.DataSource;
  4. import com.chinacreator.videoalliance.query.bean.QueryMobBean;
  5. import org.apache.log4j.Logger;
  6. import org.springframework.cache.annotation.Cacheable;
  7. import org.springframework.stereotype.Component;
  8. import java.sql.SQLException;
  9. import java.util.List;
  10. @Component
  11. public class MobDao extends ExecutorDao {
  12. public boolean checkTransfer(String userid) throws SQLException{
  13. List<String> count= this.getExecutor().queryListWithDBName(String.class,DataSource.NET3G, "querytransfer",userid);
  14. if(count!=null && count.size()>0){
  15. return Integer.parseInt(count.get(0))>0? true:false;
  16. }
  17. return false;
  18. }
  19. public boolean checkArea(String userid) throws SQLException{
  20. userid=userid.substring(0,7);
  21. List<String> count= this.getExecutor().queryListWithDBName(String.class,DataSource.NET3G, "queryArea",userid);
  22. if(count!=null && count.size()>0){
  23. return Integer.parseInt(count.get(0))>0? true:false;
  24. }
  25. return false;
  26. }
  27. @Cacheable(value = "queryMobConfig:")
  28. public QueryMobBean getConfig(String channel){
  29. QueryMobBean bean=null;
  30. try {
  31. bean = this.getExecutor().queryObjectWithDBName(QueryMobBean.class, DataSource.NET3G,"getMobConfig", channel);
  32. }catch (Exception e){
  33. bean=null;
  34. }
  35. return bean;
  36. }
  37. }