Commit 6b1e125a authored by 赵啸非's avatar 赵啸非

添加查询缓存

parent e500fb9c
......@@ -73,7 +73,7 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
//判断查询结果是否用缓存
if (!ObjectUtils.isEmpty(query) && !ObjectUtils.isEmpty(query.getSearchCache() == YesNoEnum.YES.getValue())) {
//根据查询条件 获取缓存,如果缓存有则直接取缓存,否则读数据库后 再写入缓存
if (ObjectUtils.isEmpty(query.getSiteBusinessId())) {
if (!ObjectUtils.isEmpty(query.getSiteBusinessId())) {
Long siteBusinessId = query.getSiteBusinessId();
String cacheResult = cacheService.get(KEY_SEARCH_SITEBUSINESSID_CACHE + siteBusinessId, String.class);
if (!ObjectUtils.isEmpty(cacheResult)) {
......@@ -87,10 +87,10 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
cacheService.set(KEY_SEARCH_SITEBUSINESSID_CACHE + siteBusinessId, JSON.toJSONString(result), KEY_SEARCH_TIMEOUTT_CACHE);
return result;
}
} else if (ObjectUtils.isEmpty(query.getWindowId())) {
} else if (!ObjectUtils.isEmpty(query.getWindowId())) {
//todo
return null;
} else if (ObjectUtils.isEmpty(query.getWindowIdList())) {
} else if (!ObjectUtils.isEmpty(query.getWindowIdList())) {
//todo
return null;
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment