admin
2025-02-25 30d8e227e8d823b6c38c3b9c90ac2df03b63befe
fanli/src/main/java/com/yeshi/fanli/service/impl/config/SuperHotSearchSerivceImpl.java
@@ -1,67 +1,67 @@
package com.yeshi.fanli.service.impl.config;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.goods.SuperHotSearchMapper;
import com.yeshi.fanli.entity.bus.search.HotSearch;
import com.yeshi.fanli.entity.bus.su.search.SuperHotSearch;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.config.SuperHotSearchService;
@Service
public class SuperHotSearchSerivceImpl implements SuperHotSearchService {
   @Resource
   private SuperHotSearchMapper superHotSearchMapper;
   @Resource
   private BusinessSystemService businessSystemService;
   public List<SuperHotSearch> getSuperHotSearchBySystemId(long id) {
      return superHotSearchMapper.listBySystemId(id);
   }
   @Override
   public List<SuperHotSearch> listSuperHotSearch(List<Long> list) {
      if (list == null || list.size() == 0) {
         return null;
      }
      return superHotSearchMapper.listByHotSearchListID(list);
   }
   @Override
   @Cacheable(value = "crgCache", key = "'getSuperHotSearchBySystemIdCache'+#id")
   public List<SuperHotSearch> getSuperHotSearchBySystemIdCache(long id) {
      return getSuperHotSearchBySystemId(id);
   }
   @Override
   public List<SuperHotSearch> getHotSearchSystem(Long id, Long systemId) {
      return superHotSearchMapper.listBySystemIdAndHotSearchId(id, systemId);
   }
   @Override
   public void deleteSuper(Long id, Long systemId) {
      superHotSearchMapper.deleteBySystemIdAndHotSearchId(id,systemId);
   }
   @Override
   public void addSuper(Long id, BusinessSystem system) {
      SuperHotSearch superHotSearch = new SuperHotSearch();
      HotSearch hotSearch = new HotSearch();
      hotSearch.setId(id);
      superHotSearch.setHotSearch(hotSearch);
      superHotSearch.setSystem(system);
      superHotSearchMapper.insert(superHotSearch);
   }
}
package com.yeshi.fanli.service.impl.config;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.goods.SuperHotSearchMapper;
import com.yeshi.fanli.entity.bus.search.HotSearch;
import com.yeshi.fanli.entity.bus.su.search.SuperHotSearch;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.config.SuperHotSearchService;
@Service
public class SuperHotSearchSerivceImpl implements SuperHotSearchService {
   @Resource
   private SuperHotSearchMapper superHotSearchMapper;
   @Resource
   private BusinessSystemService businessSystemService;
   public List<SuperHotSearch> getSuperHotSearchBySystemId(long id, Integer useType) {
      return superHotSearchMapper.listBySystemId(id, useType);
   }
   @Override
   public List<SuperHotSearch> listSuperHotSearch(List<Long> list) {
      if (list == null || list.size() == 0) {
         return null;
      }
      return superHotSearchMapper.listByHotSearchListID(list);
   }
   @Override
   @Cacheable(value = "crgCache", key = "'getSuperHotSearchBySystemIdCache-'+#id+'-'+#useType")
   public List<SuperHotSearch> getSuperHotSearchBySystemIdCache(long id, Integer useType) {
      return getSuperHotSearchBySystemId(id, useType);
   }
   @Override
   public List<SuperHotSearch> getHotSearchSystem(Long id, Long systemId) {
      return superHotSearchMapper.listBySystemIdAndHotSearchId(id, systemId);
   }
   @Override
   public void deleteSuper(Long id, Long systemId) {
      superHotSearchMapper.deleteBySystemIdAndHotSearchId(id,systemId);
   }
   @Override
   public void addSuper(Long id, BusinessSystem system) {
      SuperHotSearch superHotSearch = new SuperHotSearch();
      HotSearch hotSearch = new HotSearch();
      hotSearch.setId(id);
      superHotSearch.setHotSearch(hotSearch);
      superHotSearch.setSystem(system);
      superHotSearchMapper.insert(superHotSearch);
   }
}