|
@@ -1,11 +1,17 @@
|
1
|
1
|
package com.huiju.estateagents.service.impl;
|
2
|
2
|
|
|
3
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
3
|
4
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
5
|
+import com.huiju.estateagents.base.ResponseBean;
|
|
6
|
+import com.huiju.estateagents.common.CommConstant;
|
4
|
7
|
import com.huiju.estateagents.entity.ExtendContent;
|
5
|
8
|
import com.huiju.estateagents.mapper.ExtendContentMapper;
|
6
|
9
|
import com.huiju.estateagents.service.IExtendContentService;
|
|
10
|
+import org.springframework.beans.factory.annotation.Autowired;
|
7
|
11
|
import org.springframework.stereotype.Service;
|
8
|
12
|
|
|
13
|
+import java.util.List;
|
|
14
|
+
|
9
|
15
|
/**
|
10
|
16
|
* <p>
|
11
|
17
|
* 辅助内容表 服务实现类
|
|
@@ -17,4 +23,48 @@ import org.springframework.stereotype.Service;
|
17
|
23
|
@Service
|
18
|
24
|
public class ExtendContentServiceImpl extends ServiceImpl<ExtendContentMapper, ExtendContent> implements IExtendContentService {
|
19
|
25
|
|
|
26
|
+ @Autowired
|
|
27
|
+ private ExtendContentMapper extendContentMapper;
|
|
28
|
+ @Override
|
|
29
|
+ public ResponseBean extendContentAdd(ExtendContent extendContent) {
|
|
30
|
+ ResponseBean responseBean= new ResponseBean<>();
|
|
31
|
+ if ("1".equals(extendContent.getContentType())){
|
|
32
|
+ extendContent.setContentType(CommConstant.CAROUSEL_ACTIVITY);
|
|
33
|
+ }else if("2".equals(extendContent.getContentType())){
|
|
34
|
+ extendContent.setContentType(CommConstant.CAROUSEL_PROJECT);
|
|
35
|
+ }else if ("3".equals(extendContent.getContentType())){
|
|
36
|
+ extendContent.setContentType(CommConstant.CAROUSEL_INFORMATION);
|
|
37
|
+ }
|
|
38
|
+ extendContentMapper.insert(extendContent);
|
|
39
|
+ responseBean.addSuccess("成功");
|
|
40
|
+ return responseBean;
|
|
41
|
+ }
|
|
42
|
+
|
|
43
|
+ @Override
|
|
44
|
+ public ResponseBean selectExtendContentList(ExtendContent extendContent) {
|
|
45
|
+ ResponseBean responseBean = new ResponseBean<>();
|
|
46
|
+ // 查询轮播图
|
|
47
|
+ QueryWrapper<ExtendContent> extendContentQuery= new QueryWrapper<>();
|
|
48
|
+ extendContentQuery.eq("show_position",CommConstant.CAROUSEL);
|
|
49
|
+ extendContentQuery.eq("content_type",extendContent.getContentType());
|
|
50
|
+ extendContentQuery.eq("building_id",extendContent.getBuildingId());
|
|
51
|
+ extendContentQuery.eq("status","1");
|
|
52
|
+ List<ExtendContent> taExtendContent = extendContentMapper.selectList(extendContentQuery);
|
|
53
|
+ responseBean.addSuccess(taExtendContent);
|
|
54
|
+ return responseBean;
|
|
55
|
+ }
|
|
56
|
+
|
|
57
|
+ @Override
|
|
58
|
+ public ResponseBean selectExtendContentListShowType(ExtendContent extendContent) {
|
|
59
|
+ ResponseBean responseBean= new ResponseBean<>();
|
|
60
|
+ // 开屏
|
|
61
|
+ QueryWrapper<ExtendContent> extendContentQuery= new QueryWrapper<>();
|
|
62
|
+ extendContentQuery.eq("show_type",CommConstant.OPEN_SCREEN);
|
|
63
|
+ extendContentQuery.eq("content_type",extendContent.getContentType());
|
|
64
|
+ extendContentQuery.eq("building_id",extendContent.getBuildingId());
|
|
65
|
+ extendContentQuery.eq("status","1");
|
|
66
|
+ ExtendContent taExtendContent = extendContentMapper.selectOne(extendContentQuery);
|
|
67
|
+ responseBean.addSuccess(taExtendContent);
|
|
68
|
+ return responseBean;
|
|
69
|
+ }
|
20
|
70
|
}
|