| | |
| | | import com.java110.common.util.SerializeUtil; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import com.java110.entity.mapping.CodeMapping; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @Transactional |
| | | public class CommonServiceDaoImpl extends BaseServiceDao implements ICommonServiceDao { |
| | | |
| | | protected final static Logger logger = LoggerFactory.getLogger(CommonServiceDaoImpl.class); |
| | | |
| | | |
| | | /** |
| | | * 查询所有有效的映射数据 |
| | | * |
| | |
| | | @Override |
| | | @Cacheable(key= "CodeMappingAll") |
| | | public List<CodeMapping> getCodeMappingAll() throws Exception{ |
| | | Jedis jedis = jedisPool.getResource(); |
| | | Jedis jedis = this.getJedis(); |
| | | |
| | | List<CodeMapping> codeMappings = null; |
| | | if(jedis.exists("CodeMappingAll".getBytes())){ |
| | |
| | | @Cacheable(key= "CodeMappingByDomain") |
| | | public List<CodeMapping> getCodeMappingByDomain(CodeMapping codeMapping) throws Exception{ |
| | | |
| | | Jedis jedis = jedisPool.getResource(); |
| | | Jedis jedis = this.getJedis(); |
| | | List<CodeMapping> codeMappings = null; |
| | | if(jedis.exists("CodeMappingByDomain".getBytes())){ |
| | | codeMappings = SerializeUtil.unserializeList(jedis.get("CodeMappingByDomain".getBytes()),CodeMapping.class); |
| | |
| | | @Cacheable(key= "CodeMappingByHCode") |
| | | public List<CodeMapping> getCodeMappingByHCode(CodeMapping codeMapping) throws Exception{ |
| | | |
| | | Jedis jedis = jedisPool.getResource(); |
| | | Jedis jedis = this.getJedis(); |
| | | List<CodeMapping> codeMappings = null; |
| | | if(jedis.exists("CodeMappingByHCode".getBytes())){ |
| | | codeMappings = SerializeUtil.unserializeList(jedis.get("CodeMappingByHCode".getBytes()),CodeMapping.class); |
| | |
| | | @Cacheable(key= "CodeMappingByPCode") |
| | | public List<CodeMapping> getCodeMappingByPCode(CodeMapping codeMapping) throws Exception{ |
| | | |
| | | Jedis jedis = jedisPool.getResource(); |
| | | Jedis jedis = this.getJedis(); |
| | | List<CodeMapping> codeMappings = null; |
| | | if(jedis.exists("CodeMappingByPCode".getBytes())){ |
| | | codeMappings = SerializeUtil.unserializeList(jedis.get("CodeMappingByPCode".getBytes()),CodeMapping.class); |
| | |
| | | @Cacheable(key= "CodeMappingByDomainAndHCode") |
| | | public List<CodeMapping> getCodeMappingByDomainAndHCode(CodeMapping codeMapping) throws Exception{ |
| | | |
| | | Jedis jedis = jedisPool.getResource(); |
| | | Jedis jedis = this.getJedis(); |
| | | List<CodeMapping> codeMappings = null; |
| | | if(jedis.exists("CodeMappingByDomainAndHCode".getBytes())){ |
| | | codeMappings = SerializeUtil.unserializeList(jedis.get("CodeMappingByDomainAndHCode".getBytes()),CodeMapping.class); |
| | |
| | | @Cacheable(key= "CodeMappingByDomainAndPCode") |
| | | public List<CodeMapping> getCodeMappingByDomainAndPCode(CodeMapping codeMapping) throws Exception{ |
| | | |
| | | Jedis jedis = jedisPool.getResource(); |
| | | Jedis jedis = this.getJedis(); |
| | | List<CodeMapping> codeMappings = null; |
| | | if(jedis.exists("CodeMappingByDomainAndPCode".getBytes())){ |
| | | codeMappings = SerializeUtil.unserializeList(jedis.get("CodeMappingByDomainAndPCode".getBytes()),CodeMapping.class); |