1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package com.chinacreator.videoalliance.query.dao;
- import com.chinacreator.common.dao.ExecutorDao;
- import com.chinacreator.videoalliance.common.util.DataSource;
- import com.chinacreator.videoalliance.query.bean.QueryMobBean;
- import org.apache.log4j.Logger;
- import org.springframework.cache.annotation.Cacheable;
- import org.springframework.stereotype.Component;
- import java.sql.SQLException;
- import java.util.List;
- @Component
- public class MobDao extends ExecutorDao {
- public boolean checkTransfer(String userid) throws SQLException{
- List<String> count= this.getExecutor().queryListWithDBName(String.class,DataSource.NET3G, "querytransfer",userid);
- if(count!=null && count.size()>0){
- return Integer.parseInt(count.get(0))>0? true:false;
- }
- return false;
- }
- public boolean checkArea(String userid) throws SQLException{
- userid=userid.substring(0,7);
- List<String> count= this.getExecutor().queryListWithDBName(String.class,DataSource.NET3G, "queryArea",userid);
- if(count!=null && count.size()>0){
- return Integer.parseInt(count.get(0))>0? true:false;
- }
- return false;
- }
- @Cacheable(value = "queryMobConfig:")
- public QueryMobBean getConfig(String channel){
- QueryMobBean bean=null;
- try {
- bean = this.getExecutor().queryObjectWithDBName(QueryMobBean.class, DataSource.NET3G,"getMobConfig", channel);
- }catch (Exception e){
- bean=null;
- }
- return bean;
- }
- }
|