|
|
@@ -4,6 +4,9 @@ import cn.reghao.tnb.content.app.geo.db.mapper.CameraPhotoMapper;
|
|
|
import cn.reghao.tnb.content.app.geo.db.mapper.MallReplyMapper;
|
|
|
import cn.reghao.tnb.content.app.geo.model.po.CameraPhoto;
|
|
|
import cn.reghao.tnb.content.app.geo.model.po.MallReply;
|
|
|
+import cn.reghao.tnb.content.app.geo.model.vo.MapMarker;
|
|
|
+import org.springframework.cache.annotation.CacheEvict;
|
|
|
+import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.stereotype.Repository;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -23,9 +26,31 @@ public class MallReplyRepository {
|
|
|
this.cameraPhotoMapper = cameraPhotoMapper;
|
|
|
}
|
|
|
|
|
|
+ @CacheEvict(cacheNames = "tnb:geo:mark", key = "#mallReply.itemType")
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void saveTmallReply(MallReply mallReply, List<CameraPhoto> list) {
|
|
|
mallReplyMapper.save(mallReply);
|
|
|
cameraPhotoMapper.saveAll(list);
|
|
|
}
|
|
|
+
|
|
|
+ @Cacheable(cacheNames = "tnb:geo:mark", key = "#itemType", unless = "#result == null")
|
|
|
+ public List<MapMarker> findMapMarkers(int itemType, int pageSize) {
|
|
|
+ List<MapMarker> list;
|
|
|
+ if (itemType == 1) {
|
|
|
+ pageSize = 1000;
|
|
|
+ list = cameraPhotoMapper.findAlbumIdGroup(pageSize);
|
|
|
+ } else if (itemType == 2) {
|
|
|
+ list = cameraPhotoMapper.findByImagePost(pageSize);
|
|
|
+ } else if (itemType == 3) {
|
|
|
+ pageSize = 1000;
|
|
|
+ list = cameraPhotoMapper.findByMallReply(pageSize);
|
|
|
+ } else if (itemType == 4) {
|
|
|
+ pageSize = 1000;
|
|
|
+ list = cameraPhotoMapper.findByMallReplyCup(pageSize, itemType);
|
|
|
+ } else {
|
|
|
+ list = cameraPhotoMapper.findByMallReplyItem(pageSize, itemType);
|
|
|
+ }
|
|
|
+
|
|
|
+ return list;
|
|
|
+ }
|
|
|
}
|