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