admin
2019-07-30 573c491b4a1ba60e12a5678a01c1546c0077c1ee
fanli/src/main/java/com/yeshi/fanli/service/impl/config/BusinessSystemServiceImpl.java
@@ -1,6 +1,5 @@
package com.yeshi.fanli.service.impl.config;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -10,7 +9,7 @@
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.config.BusinessSystemDao;
import com.yeshi.fanli.dao.mybatis.BusinessSystemMapper;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
@@ -18,7 +17,7 @@
public class BusinessSystemServiceImpl implements BusinessSystemService {
   @Resource
   private BusinessSystemDao businessSystemDao;
   private BusinessSystemMapper businessSystemMapper;
   private static final String ANDROID = "ANDROID";
   private static final String IOS = "IOS";
@@ -31,9 +30,8 @@
      map.put(IOS, 2);
      map.put(WEB, 3);
   }
   @Override
   @Cacheable(value = "sysCache", key = "'getBusinessSystem-'+#platform+'-'+#packages")
   public BusinessSystem getBusinessSystem(String platform, String packages) {
      if (platform == null || packages == null) {
         return null;
@@ -41,27 +39,27 @@
      platform = platform.toUpperCase();
      Integer platformInt = map.get(platform);
      List<BusinessSystem> list = businessSystemDao.list("from BusinessSystem where platform=? and packageName=?",
            new Serializable[] { platformInt, packages });
      List<BusinessSystem> list = businessSystemMapper.listByPlatformAndPackage(platformInt, packages);
      if (list == null || list.size() == 0) {
         return null;
      }
      return list.get(0);
   }
   @Cacheable(value = "sysCache", key = "'getBusinessSystem-'+#platform+'-'+#packages")
   @Override
   public BusinessSystem getBusinessSystemCache(String platform, String packages) {
      return getBusinessSystem(platform, packages);
   }
   @Override
   public BusinessSystem getById(long id) {
      return businessSystemDao.find(BusinessSystem.class, id);
      return businessSystemMapper.selectByPrimaryKey(id);
   }
   @Override
   public List<BusinessSystem> getBusinessSystems() {
      return businessSystemDao.list("from BusinessSystem");
      return businessSystemMapper.listAll();
   }
}