package com.chinacreator.videoalliance.smc.dao; import com.chinacreator.common.support.cache.annotation.CacheName; import com.chinacreator.videoalliance.common.util.DataSource; import com.frameworkset.common.poolman.SQLExecutor; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Component; import java.sql.SQLException; @Component @CacheName("SmsContentDao") public class SmsContentDao { @Cacheable(value="SmsContentDao", key = "#cpid.concat(#spid).concat(#channel) + 'SmsContent'") public String getContent(String cpid,String spid,String channel) throws SQLException { String sql = "select CONTENT from TB_SMSCONTENT_INFO where cpid in (?,'0') and spid in (?,'0') and status=1 " + " and channel in (?,'0') order by cpid desc,spid desc,channel desc"; return SQLExecutor.queryFieldWithDBName(DataSource.NET3G, sql, cpid,spid,channel); } }