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 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 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; } }