Quellcode durchsuchen

合并本地分支

weiximei vor 6 Jahren
Ursprung
Commit
ed9c63d3e8
27 geänderte Dateien mit 1663 neuen und 580 gelöschten Zeilen
  1. 6
    0
      CODE/smart-community/app-api/pom.xml
  2. 0
    7
      CODE/smart-community/app-api/src/main/java/com/community/huiju/common/code/impl/PhoneCodeImpl.java
  3. 7
    3
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/BannerController.java
  4. 32
    4
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/MessageController.java
  5. 61
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java
  6. 2
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/ToBannerMapper.java
  7. 20
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpActivityMapper.java
  8. 21
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpAnnouncementMapper.java
  9. 4
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpMessageMapper.java
  10. 185
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpActivity.java
  11. 135
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpAnnouncement.java
  12. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/BannerServiceI.java
  13. 19
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/MessageServiceI.java
  14. 24
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java
  15. 10
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TpActivityServiceI.java
  16. 2
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/BannerServiceImpl.java
  17. 30
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/MessageServiceImpl.java
  18. 39
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java
  19. 15
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TpActivityServiceImpl.java
  20. 11
    1
      CODE/smart-community/app-api/src/main/resources/application.yml
  21. 2
    2
      CODE/smart-community/app-api/src/main/resources/mapper/ToBannerMapper.xml
  22. 249
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TpActivityMapper.xml
  23. 189
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TpAnnouncementMapper.xml
  24. 16
    1
      CODE/smart-community/app-api/src/main/resources/mapper/TpMessageMapper.xml
  25. 5
    0
      CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java
  26. 289
    277
      文档/MYSQL/smartCommunity.pdb
  27. 289
    277
      文档/MYSQL/smartCommunity.pdm

+ 6
- 0
CODE/smart-community/app-api/pom.xml Datei anzeigen

@@ -71,6 +71,12 @@
71 71
 			<version>1.3.2</version>
72 72
 		</dependency>
73 73
 
74
+		<dependency>
75
+			<groupId>com.github.pagehelper</groupId>
76
+			<artifactId>pagehelper-spring-boot-starter</artifactId>
77
+			<version>1.2.3</version>
78
+		</dependency>
79
+
74 80
 		<dependency>
75 81
 			<groupId>mysql</groupId>
76 82
 			<artifactId>mysql-connector-java</artifactId>

+ 0
- 7
CODE/smart-community/app-api/src/main/java/com/community/huiju/common/code/impl/PhoneCodeImpl.java Datei anzeigen

@@ -1,18 +1,11 @@
1 1
 package com.community.huiju.common.code.impl;
2 2
 
3
-import com.alibaba.fastjson.JSONObject;
4 3
 import com.community.commom.constant.Constant;
5
-import com.community.commom.utils.HttpClientUtils;
6 4
 import com.community.huiju.common.code.ICode;
7
-import com.community.huiju.common.code.cache.AppkeyCache;
8
-import com.community.huiju.common.code.entity.CodeEntity;
9
-import lombok.extern.log4j.Log4j;
10 5
 import lombok.extern.slf4j.Slf4j;
11 6
 import okhttp3.*;
12 7
 import org.springframework.beans.factory.annotation.Autowired;
13 8
 import org.springframework.stereotype.Service;
14
-import org.springframework.util.LinkedMultiValueMap;
15
-import org.springframework.util.MultiValueMap;
16 9
 import org.springframework.web.client.RestTemplate;
17 10
 
18 11
 import java.io.IOException;

+ 7
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/BannerController.java Datei anzeigen

@@ -4,10 +4,13 @@ import com.community.commom.mode.ResponseBean;
4 4
 import com.community.huiju.model.ToBanner;
5 5
 import com.community.huiju.service.BannerServiceI;
6 6
 import io.swagger.annotations.Api;
7
+import io.swagger.annotations.ApiImplicitParam;
8
+import io.swagger.annotations.ApiImplicitParams;
7 9
 import io.swagger.annotations.ApiOperation;
8 10
 import org.springframework.beans.factory.annotation.Autowired;
9 11
 import org.springframework.cloud.context.config.annotation.RefreshScope;
10 12
 import org.springframework.util.CollectionUtils;
13
+import org.springframework.web.bind.annotation.PathVariable;
11 14
 import org.springframework.web.bind.annotation.RequestMapping;
12 15
 import org.springframework.web.bind.annotation.RequestMethod;
13 16
 import org.springframework.web.bind.annotation.RestController;
@@ -30,10 +33,11 @@ public class BannerController {
30 33
     private BannerServiceI bannerService;
31 34
 
32 35
     @ApiOperation(value = "首页运营banner接口", notes = "获取首页运营banner")
33
-    @RequestMapping(value = "/banners", method = RequestMethod.GET)
34
-    public ResponseBean selectToBannerImg(){
36
+    @RequestMapping(value = "/banner/{bannerId}", method = RequestMethod.GET)
37
+    @ApiImplicitParams({ @ApiImplicitParam(paramType = "query", dataType = "Long", name = "bannerId", value = "运营banner图Id") })
38
+    public ResponseBean selectToBannerImg(@PathVariable("bannerId")Integer bannerId){
35 39
         ResponseBean responseBean = new ResponseBean();
36
-        List<ToBanner> toBannerList = bannerService.viewBannerImg();
40
+        ToBanner toBannerList = bannerService.viewBannerImg(bannerId);
37 41
         responseBean.addSuccess(toBannerList);
38 42
         return responseBean;
39 43
     }

+ 32
- 4
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/MessageController.java Datei anzeigen

@@ -1,7 +1,9 @@
1 1
 package com.community.huiju.controller;
2 2
 
3
+import com.community.commom.constant.Constant;
3 4
 import com.community.commom.mode.ResponseBean;
4 5
 import com.community.huiju.model.ToCommunities;
6
+import com.community.huiju.model.TpMessage;
5 7
 import com.community.huiju.service.MessageServiceI;
6 8
 import io.swagger.annotations.Api;
7 9
 import io.swagger.annotations.ApiImplicitParam;
@@ -9,6 +11,7 @@ import io.swagger.annotations.ApiImplicitParams;
9 11
 import io.swagger.annotations.ApiOperation;
10 12
 import org.springframework.beans.factory.annotation.Autowired;
11 13
 import org.springframework.cloud.context.config.annotation.RefreshScope;
14
+import org.springframework.web.bind.annotation.PathVariable;
12 15
 import org.springframework.web.bind.annotation.RequestMapping;
13 16
 import org.springframework.web.bind.annotation.RequestMethod;
14 17
 import org.springframework.web.bind.annotation.RequestParam;
@@ -30,12 +33,37 @@ public class MessageController {
30 33
 	@Autowired
31 34
 	private MessageServiceI messageService;
32 35
 	
33
-	@ApiOperation(value = "根据小区名获取小区列表", notes = "根据小区名获取小区列表")
34
-	@RequestMapping(value = "/message/total",method = RequestMethod.GET)
35
-	public ResponseBean getMessageTotal(){
36
+	@ApiOperation(value = "按小区获取消息总数", notes = "按小区获取个人消息总数")
37
+	@ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区Id") })
38
+	@RequestMapping(value = "/message/{communityId}/total",method = RequestMethod.GET)
39
+	public ResponseBean getMessageTotal(@PathVariable Integer communityId){
36 40
 		ResponseBean responseBean = new ResponseBean();
37
-		Map<String,Object> totalMap = messageService.getMessageTotal();
41
+		Map<String,Object> totalMap = messageService.getMessageTotal(communityId);
38 42
 		responseBean.addSuccess(totalMap);
39 43
 		return responseBean;
40 44
 	}
45
+	
46
+	@ApiOperation(value = "按小区获取分页消息", notes = "按小区获取分页消息")
47
+	@ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区Id"),
48
+			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
49
+			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")})
50
+	@RequestMapping(value = "/message/{communityId}/news",method = RequestMethod.GET)
51
+	public ResponseBean getNews(@PathVariable Integer communityId,@RequestParam Integer pageNum,@RequestParam Integer pageSize){
52
+		ResponseBean responseBean = new ResponseBean();
53
+		List<TpMessage> newsList = messageService.getMessages(communityId,pageNum,pageSize, Constant.MODEL_TYPE_NEWS);
54
+		responseBean.addSuccess(newsList);
55
+		return responseBean;
56
+	}
57
+	
58
+	@ApiOperation(value = "按小区获取分页待办", notes = "按小区获取分页待办")
59
+	@ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区Id"),
60
+			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
61
+			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")})
62
+	@RequestMapping(value = "/message/{communityId}/upcoming",method = RequestMethod.GET)
63
+	public ResponseBean getUpcoming(@PathVariable Integer communityId,@RequestParam Integer pageNum,@RequestParam Integer pageSize){
64
+		ResponseBean responseBean = new ResponseBean();
65
+		List<TpMessage> upcomingList = messageService.getMessages(communityId,pageNum,pageSize,Constant.MODEL_TYPE_UPCOMING);
66
+		responseBean.addSuccess(upcomingList);
67
+		return responseBean;
68
+	}
41 69
 }

+ 61
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java Datei anzeigen

@@ -0,0 +1,61 @@
1
+package com.community.huiju.controller;
2
+
3
+import com.community.commom.constant.Constant;
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.huiju.model.TpAnnouncement;
6
+import com.community.huiju.model.TpMessage;
7
+import com.community.huiju.service.SocialServiceI;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiImplicitParam;
10
+import io.swagger.annotations.ApiImplicitParams;
11
+import io.swagger.annotations.ApiOperation;
12
+import org.springframework.beans.factory.annotation.Autowired;
13
+import org.springframework.cloud.context.config.annotation.RefreshScope;
14
+import org.springframework.web.bind.annotation.*;
15
+
16
+import java.util.List;
17
+
18
+/**
19
+ * @author weichaochao
20
+ * @Title: SocialController
21
+ * @date 2018/10/23
22
+ */
23
+@RestController
24
+@RefreshScope
25
+@RequestMapping("/")
26
+@Api("app端论坛相关的API")
27
+public class SocialController {
28
+
29
+    @Autowired
30
+    private SocialServiceI socialServiceI;
31
+
32
+    @RequestMapping(value = "/announcement/{communityId}", method = RequestMethod.GET)
33
+    @ApiOperation(value = "论坛公告帖子详情", notes = "获取论坛公告帖子详情")
34
+    @ApiImplicitParams({ @ApiImplicitParam(paramType = "query", dataType = "Long", name = "communityId", value = "小区Id") })
35
+    public ResponseBean findAnnouncementDetail(@PathVariable(value = "communityId")Integer communityId, @RequestParam("id") Integer id){
36
+        ResponseBean responseBean = new ResponseBean();
37
+        TpAnnouncement tpAnnouncement = socialServiceI.findAnnouncementDetail(id, communityId);
38
+        responseBean.addSuccess(tpAnnouncement);
39
+        return responseBean;
40
+    }
41
+
42
+    @RequestMapping(value = "/sign", method = RequestMethod.GET)
43
+    @ApiOperation(value = "活动报名接口", notes = "活动报名接口")
44
+    @ApiImplicitParams({ @ApiImplicitParam(paramType = "query", dataType = "Long", name = "communityId", value = "小区Id") })
45
+    public ResponseBean SignActivity(@PathVariable(value = "communityId")Integer communityId){
46
+        ResponseBean responseBean = new ResponseBean();
47
+        return responseBean;
48
+    }
49
+    
50
+    @ApiOperation(value = "按小区获取分页活动列表", notes = "按小区获取分页活动列表")
51
+    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区Id"),
52
+            @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
53
+            @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")})
54
+    @RequestMapping(value = "/announcements/{communityId}",method = RequestMethod.GET)
55
+    public ResponseBean getAnnouncements(@PathVariable Integer communityId,@RequestParam Integer pageNum,@RequestParam Integer pageSize){
56
+        ResponseBean responseBean = new ResponseBean();
57
+        List<TpMessage> upcomingList = socialServiceI.getAnnouncements(communityId,pageNum,pageSize);
58
+        responseBean.addSuccess(upcomingList);
59
+        return responseBean;
60
+    }
61
+}

+ 2
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/ToBannerMapper.java Datei anzeigen

@@ -2,12 +2,13 @@ package com.community.huiju.dao;
2 2
 
3 3
 import com.community.huiju.model.ToBanner;
4 4
 import org.apache.ibatis.annotations.Mapper;
5
+import org.apache.ibatis.annotations.Param;
5 6
 
6 7
 import java.util.List;
7 8
 
8 9
 @Mapper
9 10
 public interface ToBannerMapper {
10 11
 
11
-    List<ToBanner> selectByCommunityId(String nowTime);
12
+    ToBanner selectByCommunityId(@Param("bannerId") Integer bannerId, @Param("nowTime") String nowTime);
12 13
 
13 14
 }

+ 20
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpActivityMapper.java Datei anzeigen

@@ -0,0 +1,20 @@
1
+package com.community.huiju.dao;
2
+
3
+
4
+import com.community.huiju.model.TpActivity;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+@Mapper
8
+public interface TpActivityMapper {
9
+    int deleteByPrimaryKey(Integer id);
10
+
11
+    int insert(TpActivity record);
12
+
13
+    int insertSelective(TpActivity record);
14
+
15
+    TpActivity selectByPrimaryKey(Integer id);
16
+
17
+    int updateByPrimaryKeySelective(TpActivity record);
18
+
19
+    int updateByPrimaryKey(TpActivity record);
20
+}

+ 21
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpAnnouncementMapper.java Datei anzeigen

@@ -0,0 +1,21 @@
1
+package com.community.huiju.dao;
2
+
3
+
4
+import com.community.huiju.model.TpAnnouncement;
5
+import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+@Mapper
9
+public interface TpAnnouncementMapper {
10
+    int deleteByPrimaryKey(Integer id);
11
+
12
+    int insert(TpAnnouncement record);
13
+
14
+    int insertSelective(TpAnnouncement record);
15
+
16
+    TpAnnouncement selectByPrimaryKey(@Param("id") Integer id, @Param("communityId") Integer communityId);
17
+
18
+    int updateByPrimaryKeySelective(TpAnnouncement record);
19
+
20
+    int updateByPrimaryKey(TpAnnouncement record);
21
+}

+ 4
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpMessageMapper.java Datei anzeigen

@@ -4,6 +4,7 @@ import com.community.huiju.model.TpMessage;
4 4
 import org.apache.ibatis.annotations.Mapper;
5 5
 import org.apache.ibatis.annotations.Param;
6 6
 
7
+import java.util.List;
7 8
 import java.util.Map;
8 9
 
9 10
 @Mapper
@@ -20,5 +21,7 @@ public interface TpMessageMapper {
20 21
 
21 22
     int updateByPrimaryKey(TpMessage record);
22 23
     
23
-    Map<String, Object> getMessageTotal(@Param(value="userId") Integer userId);
24
+    Map<String, Object> getMessageTotal(@Param(value = "userId") Integer userId,@Param(value = "communityId") Integer communityId);
25
+    
26
+    List<TpMessage> getMessages(@Param(value = "userId") Integer userId,@Param(value = "communityId") Integer communityId, @Param(value = "modelType") Integer modelType);
24 27
 }

+ 185
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpActivity.java Datei anzeigen

@@ -0,0 +1,185 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class TpActivity {
6
+    private Integer id;
7
+
8
+    private Integer communityId;
9
+
10
+    private String activityTitle;
11
+
12
+    private String activityCarouselImg;
13
+
14
+    private String activityContent;
15
+
16
+    private Integer sort;
17
+
18
+    private Integer signUpCount;
19
+
20
+    private Integer signUpMax;
21
+
22
+    private Integer viewCount;
23
+
24
+    private Date registrationStartTime;
25
+
26
+    private Date registrationEndTime;
27
+
28
+    private Date activityStartTime;
29
+
30
+    private Date activityEndTime;
31
+
32
+    private String status;
33
+
34
+    private Integer createUser;
35
+
36
+    private Date createDate;
37
+
38
+    private Integer updateUser;
39
+
40
+    private Date updateDate;
41
+
42
+    public Integer getId() {
43
+        return id;
44
+    }
45
+
46
+    public void setId(Integer id) {
47
+        this.id = id;
48
+    }
49
+
50
+    public Integer getCommunityId() {
51
+        return communityId;
52
+    }
53
+
54
+    public void setCommunityId(Integer communityId) {
55
+        this.communityId = communityId;
56
+    }
57
+
58
+    public String getActivityTitle() {
59
+        return activityTitle;
60
+    }
61
+
62
+    public void setActivityTitle(String activityTitle) {
63
+        this.activityTitle = activityTitle == null ? null : activityTitle.trim();
64
+    }
65
+
66
+    public String getActivityCarouselImg() {
67
+        return activityCarouselImg;
68
+    }
69
+
70
+    public void setActivityCarouselImg(String activityCarouselImg) {
71
+        this.activityCarouselImg = activityCarouselImg == null ? null : activityCarouselImg.trim();
72
+    }
73
+
74
+    public String getActivityContent() {
75
+        return activityContent;
76
+    }
77
+
78
+    public void setActivityContent(String activityContent) {
79
+        this.activityContent = activityContent == null ? null : activityContent.trim();
80
+    }
81
+
82
+    public Integer getSort() {
83
+        return sort;
84
+    }
85
+
86
+    public void setSort(Integer sort) {
87
+        this.sort = sort;
88
+    }
89
+
90
+    public Integer getSignUpCount() {
91
+        return signUpCount;
92
+    }
93
+
94
+    public void setSignUpCount(Integer signUpCount) {
95
+        this.signUpCount = signUpCount;
96
+    }
97
+
98
+    public Integer getSignUpMax() {
99
+        return signUpMax;
100
+    }
101
+
102
+    public void setSignUpMax(Integer signUpMax) {
103
+        this.signUpMax = signUpMax;
104
+    }
105
+
106
+    public Integer getViewCount() {
107
+        return viewCount;
108
+    }
109
+
110
+    public void setViewCount(Integer viewCount) {
111
+        this.viewCount = viewCount;
112
+    }
113
+
114
+    public Date getRegistrationStartTime() {
115
+        return registrationStartTime;
116
+    }
117
+
118
+    public void setRegistrationStartTime(Date registrationStartTime) {
119
+        this.registrationStartTime = registrationStartTime;
120
+    }
121
+
122
+    public Date getRegistrationEndTime() {
123
+        return registrationEndTime;
124
+    }
125
+
126
+    public void setRegistrationEndTime(Date registrationEndTime) {
127
+        this.registrationEndTime = registrationEndTime;
128
+    }
129
+
130
+    public Date getActivityStartTime() {
131
+        return activityStartTime;
132
+    }
133
+
134
+    public void setActivityStartTime(Date activityStartTime) {
135
+        this.activityStartTime = activityStartTime;
136
+    }
137
+
138
+    public Date getActivityEndTime() {
139
+        return activityEndTime;
140
+    }
141
+
142
+    public void setActivityEndTime(Date activityEndTime) {
143
+        this.activityEndTime = activityEndTime;
144
+    }
145
+
146
+    public String getStatus() {
147
+        return status;
148
+    }
149
+
150
+    public void setStatus(String status) {
151
+        this.status = status == null ? null : status.trim();
152
+    }
153
+
154
+    public Integer getCreateUser() {
155
+        return createUser;
156
+    }
157
+
158
+    public void setCreateUser(Integer createUser) {
159
+        this.createUser = createUser;
160
+    }
161
+
162
+    public Date getCreateDate() {
163
+        return createDate;
164
+    }
165
+
166
+    public void setCreateDate(Date createDate) {
167
+        this.createDate = createDate;
168
+    }
169
+
170
+    public Integer getUpdateUser() {
171
+        return updateUser;
172
+    }
173
+
174
+    public void setUpdateUser(Integer updateUser) {
175
+        this.updateUser = updateUser;
176
+    }
177
+
178
+    public Date getUpdateDate() {
179
+        return updateDate;
180
+    }
181
+
182
+    public void setUpdateDate(Date updateDate) {
183
+        this.updateDate = updateDate;
184
+    }
185
+}

+ 135
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpAnnouncement.java Datei anzeigen

@@ -0,0 +1,135 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class TpAnnouncement {
6
+    private Integer id;
7
+
8
+    private Integer communityId;
9
+
10
+    private String announcementTitle;
11
+
12
+    private String announcementCarouselImg;
13
+
14
+    private String announcementContent;
15
+
16
+    private Integer sort;
17
+
18
+    private Integer viewCount;
19
+
20
+    private String setUpCarousel;
21
+
22
+    private String status;
23
+
24
+    private Integer createUser;
25
+
26
+    private Date createDate;
27
+
28
+    private Integer updateUser;
29
+
30
+    private Date updateDate;
31
+
32
+    public Integer getId() {
33
+        return id;
34
+    }
35
+
36
+    public void setId(Integer id) {
37
+        this.id = id;
38
+    }
39
+
40
+    public Integer getCommunityId() {
41
+        return communityId;
42
+    }
43
+
44
+    public void setCommunityId(Integer communityId) {
45
+        this.communityId = communityId;
46
+    }
47
+
48
+    public String getAnnouncementTitle() {
49
+        return announcementTitle;
50
+    }
51
+
52
+    public void setAnnouncementTitle(String announcementTitle) {
53
+        this.announcementTitle = announcementTitle == null ? null : announcementTitle.trim();
54
+    }
55
+
56
+    public String getAnnouncementCarouselImg() {
57
+        return announcementCarouselImg;
58
+    }
59
+
60
+    public void setAnnouncementCarouselImg(String announcementCarouselImg) {
61
+        this.announcementCarouselImg = announcementCarouselImg == null ? null : announcementCarouselImg.trim();
62
+    }
63
+
64
+    public String getAnnouncementContent() {
65
+        return announcementContent;
66
+    }
67
+
68
+    public void setAnnouncementContent(String announcementContent) {
69
+        this.announcementContent = announcementContent == null ? null : announcementContent.trim();
70
+    }
71
+
72
+    public Integer getSort() {
73
+        return sort;
74
+    }
75
+
76
+    public void setSort(Integer sort) {
77
+        this.sort = sort;
78
+    }
79
+
80
+    public Integer getViewCount() {
81
+        return viewCount;
82
+    }
83
+
84
+    public void setViewCount(Integer viewCount) {
85
+        this.viewCount = viewCount;
86
+    }
87
+
88
+    public String getSetUpCarousel() {
89
+        return setUpCarousel;
90
+    }
91
+
92
+    public void setSetUpCarousel(String setUpCarousel) {
93
+        this.setUpCarousel = setUpCarousel == null ? null : setUpCarousel.trim();
94
+    }
95
+
96
+    public String getStatus() {
97
+        return status;
98
+    }
99
+
100
+    public void setStatus(String status) {
101
+        this.status = status == null ? null : status.trim();
102
+    }
103
+
104
+    public Integer getCreateUser() {
105
+        return createUser;
106
+    }
107
+
108
+    public void setCreateUser(Integer createUser) {
109
+        this.createUser = createUser;
110
+    }
111
+
112
+    public Date getCreateDate() {
113
+        return createDate;
114
+    }
115
+
116
+    public void setCreateDate(Date createDate) {
117
+        this.createDate = createDate;
118
+    }
119
+
120
+    public Integer getUpdateUser() {
121
+        return updateUser;
122
+    }
123
+
124
+    public void setUpdateUser(Integer updateUser) {
125
+        this.updateUser = updateUser;
126
+    }
127
+
128
+    public Date getUpdateDate() {
129
+        return updateDate;
130
+    }
131
+
132
+    public void setUpdateDate(Date updateDate) {
133
+        this.updateDate = updateDate;
134
+    }
135
+}

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/BannerServiceI.java Datei anzeigen

@@ -11,6 +11,6 @@ import java.util.List;
11 11
  */
12 12
 public interface BannerServiceI {
13 13
 
14
-    List<ToBanner> viewBannerImg();
14
+    ToBanner viewBannerImg(Integer bannerId);
15 15
 
16 16
 }

+ 19
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/MessageServiceI.java Datei anzeigen

@@ -1,7 +1,25 @@
1 1
 package com.community.huiju.service;
2 2
 
3
+import com.community.huiju.model.TpMessage;
4
+
5
+import java.util.List;
3 6
 import java.util.Map;
4 7
 
5 8
 public interface MessageServiceI {
6
-	Map<String, Object> getMessageTotal();
9
+	/**
10
+	 * 获取消息数量
11
+	 * @param communityId
12
+	 * @return
13
+	 */
14
+	Map<String, Object> getMessageTotal(Integer communityId);
15
+	
16
+	/**
17
+	 * 分页获取消息或待办
18
+	 * @param communityId
19
+	 * @param pageNum
20
+	 * @param pageSize
21
+	 * @param modelType
22
+	 * @return
23
+	 */
24
+	List<TpMessage> getMessages(Integer communityId, Integer pageNum, Integer pageSize,Integer modelType);
7 25
 }

+ 24
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java Datei anzeigen

@@ -0,0 +1,24 @@
1
+package com.community.huiju.service;
2
+
3
+import com.community.huiju.model.TpAnnouncement;
4
+import com.community.huiju.model.TpMessage;
5
+
6
+import java.util.List;
7
+
8
+/**
9
+ * @author weichaochao
10
+ * @Title: SocialServiceI
11
+ * @date 2018/10/23
12
+ */
13
+public interface SocialServiceI {
14
+    TpAnnouncement findAnnouncementDetail(Integer id, Integer communityId);
15
+	
16
+	/**
17
+	 * 分页获取活动列表
18
+	 * @param communityId
19
+	 * @param pageNum
20
+	 * @param pageSize
21
+	 * @return
22
+	 */
23
+	List<TpMessage> getAnnouncements(Integer communityId, Integer pageNum, Integer pageSize);
24
+}

+ 10
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TpActivityServiceI.java Datei anzeigen

@@ -0,0 +1,10 @@
1
+package com.community.huiju.service;
2
+
3
+/**
4
+ * @author weichaochao
5
+ * @Title: TpActivityServiceI
6
+ * @date 2018/10/23
7
+ */
8
+public interface TpActivityServiceI {
9
+
10
+}

+ 2
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/BannerServiceImpl.java Datei anzeigen

@@ -21,8 +21,8 @@ public class BannerServiceImpl implements BannerServiceI {
21 21
     private ToBannerMapper toBannerMapper;
22 22
 
23 23
     @Override
24
-    public List<ToBanner> viewBannerImg() {
24
+    public ToBanner viewBannerImg(Integer bannerId) {
25 25
         String nowTime = DateUtils.getDate("yyyy-MM-dd");
26
-        return toBannerMapper.selectByCommunityId(nowTime);
26
+        return toBannerMapper.selectByCommunityId(bannerId, nowTime);
27 27
     }
28 28
 }

+ 30
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/MessageServiceImpl.java Datei anzeigen

@@ -1,10 +1,13 @@
1 1
 package com.community.huiju.service.impl;
2 2
 
3 3
 import com.community.huiju.dao.TpMessageMapper;
4
+import com.community.huiju.model.TpMessage;
4 5
 import com.community.huiju.service.MessageServiceI;
6
+import com.github.pagehelper.PageHelper;
5 7
 import org.springframework.beans.factory.annotation.Autowired;
6 8
 import org.springframework.stereotype.Service;
7 9
 
10
+import java.util.List;
8 11
 import java.util.Map;
9 12
 
10 13
 /**
@@ -17,9 +20,34 @@ public class MessageServiceImpl implements MessageServiceI {
17 20
 	@Autowired
18 21
 	private TpMessageMapper tpMessageMapper;
19 22
 	
23
+	/**
24
+	 * 获取消息数量
25
+	 * @param communityId
26
+	 * @return
27
+	 */
20 28
 	@Override
21
-	public Map<String, Object> getMessageTotal() {
29
+	public Map<String, Object> getMessageTotal(Integer communityId) {
22 30
 		Integer userId = 1;
23
-		return tpMessageMapper.getMessageTotal(userId);
31
+		return tpMessageMapper.getMessageTotal(userId,communityId);
32
+	}
33
+	
34
+	/**
35
+	 * 分页获取消息或待办
36
+	 * @param communityId
37
+	 * @param pageNum
38
+	 * @param pageSize
39
+	 * @param modelType
40
+	 * @return
41
+	 */
42
+	@Override
43
+	public List<TpMessage> getMessages(Integer communityId, Integer pageNum, Integer pageSize,Integer modelType) {
44
+		Integer userId = 1;
45
+		pageNum = null == pageNum ? 1 : pageNum;
46
+		pageSize = null == pageSize ? 10 : pageSize;
47
+		//使用分页插件
48
+		PageHelper.startPage(pageNum, pageSize);
49
+		// 获取数据
50
+		List<TpMessage> messageList = tpMessageMapper.getMessages(userId,communityId, modelType);
51
+		return messageList;
24 52
 	}
25 53
 }

+ 39
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java Datei anzeigen

@@ -0,0 +1,39 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.community.huiju.dao.TpAnnouncementMapper;
4
+import com.community.huiju.model.TpAnnouncement;
5
+import com.community.huiju.model.TpMessage;
6
+import com.community.huiju.service.SocialServiceI;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.stereotype.Service;
9
+
10
+import java.util.List;
11
+
12
+/**
13
+ * @author admin
14
+ * @Title: SocialServiceImpl
15
+ * @Description: TODO
16
+ * @date 2018/10/23
17
+ */
18
+@Service("SocialService")
19
+public class SocialServiceImpl implements SocialServiceI {
20
+    @Autowired
21
+    private TpAnnouncementMapper tpAnnouncementMapper;
22
+    @Override
23
+    public TpAnnouncement findAnnouncementDetail(Integer id, Integer communityId) {
24
+        return tpAnnouncementMapper.selectByPrimaryKey(id, communityId);
25
+    }
26
+    
27
+    /**
28
+     * 分页获取活动列表
29
+     * @param communityId
30
+     * @param pageNum
31
+     * @param pageSize
32
+     * @return
33
+     */
34
+    @Override
35
+    public List<TpMessage> getAnnouncements(Integer communityId, Integer pageNum, Integer pageSize) {
36
+        Integer userId = 1;
37
+        return null;
38
+    }
39
+}

+ 15
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TpActivityServiceImpl.java Datei anzeigen

@@ -0,0 +1,15 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.community.huiju.service.TpActivityServiceI;
4
+import org.springframework.stereotype.Service;
5
+
6
+/**
7
+ * @author admin
8
+ * @Title: TpActivityServiceImpl
9
+ * @Description: TODO
10
+ * @date 2018/10/23
11
+ */
12
+@Service("TpActivityService")
13
+public class TpActivityServiceImpl implements TpActivityServiceI {
14
+
15
+}

+ 11
- 1
CODE/smart-community/app-api/src/main/resources/application.yml Datei anzeigen

@@ -6,4 +6,14 @@ management:
6 6
 ## Mybatis
7 7
 mybatis:
8 8
   typeAliasesPackage: com.community.huiju.model
9
-  mapperLocations: classpath:mapper/*.xml
9
+  mapperLocations: classpath:mapper/*.xml
10
+# 分页配置
11
+pagehelper:
12
+  helper-dialect: mysql
13
+  reasonable: true
14
+  support-methods-arguments: true
15
+  params: count=countSql
16
+# 打印sql
17
+logging:
18
+  level:
19
+    com.community.huiju.dao: debug

+ 2
- 2
CODE/smart-community/app-api/src/main/resources/mapper/ToBannerMapper.xml Datei anzeigen

@@ -21,9 +21,9 @@
21 21
     id, community_id, banner_description, sort, banner_cover, banner_position, eff_time, 
22 22
     exp_time, banner_type, external_link, banner_title, banner_content, create_user, create_date
23 23
   </sql>
24
-  <select id="selectByCommunityId" resultMap="BaseResultMap" parameterType="java.lang.String">
24
+  <select id="selectByCommunityId" resultMap="BaseResultMap">
25 25
     select
26 26
     <include refid="Base_Column_List"></include>
27
-    from to_banner t where t.eff_time &lt; #{nowTime} and t.exp_time &gt; #{nowTime} order by t.sort, t.eff_time
27
+    from to_banner t where id = #{bannerId} and t.eff_time &lt; #{nowTime} and t.exp_time &gt; #{nowTime} order by t.sort, t.eff_time
28 28
   </select>
29 29
 </mapper>

+ 249
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpActivityMapper.xml Datei anzeigen

@@ -0,0 +1,249 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.TpActivityMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TpActivity" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="activity_title" property="activityTitle" jdbcType="VARCHAR" />
8
+    <result column="activity_carousel_img" property="activityCarouselImg" jdbcType="VARCHAR" />
9
+    <result column="activity_content" property="activityContent" jdbcType="VARCHAR" />
10
+    <result column="sort" property="sort" jdbcType="INTEGER" />
11
+    <result column="sign_up_count" property="signUpCount" jdbcType="INTEGER" />
12
+    <result column="sign_up_max" property="signUpMax" jdbcType="INTEGER" />
13
+    <result column="view_count" property="viewCount" jdbcType="INTEGER" />
14
+    <result column="registration_start_time" property="registrationStartTime" jdbcType="TIMESTAMP" />
15
+    <result column="registration_end_time" property="registrationEndTime" jdbcType="TIMESTAMP" />
16
+    <result column="activity_start_time" property="activityStartTime" jdbcType="TIMESTAMP" />
17
+    <result column="activity_end_time" property="activityEndTime" jdbcType="TIMESTAMP" />
18
+    <result column="status" property="status" jdbcType="CHAR" />
19
+    <result column="create_user" property="createUser" jdbcType="INTEGER" />
20
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
21
+    <result column="update_user" property="updateUser" jdbcType="INTEGER" />
22
+    <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
23
+  </resultMap>
24
+  <sql id="Base_Column_List" >
25
+    id, community_id, activity_title, activity_carousel_img, activity_content, sort, 
26
+    sign_up_count, sign_up_max, view_count, registration_start_time, registration_end_time, 
27
+    activity_start_time, activity_end_time, status, create_user, create_date, update_user, 
28
+    update_date
29
+  </sql>
30
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
31
+    select 
32
+    <include refid="Base_Column_List" />
33
+    from tp_activity
34
+    where id = #{id,jdbcType=INTEGER}
35
+  </select>
36
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
37
+    delete from tp_activity
38
+    where id = #{id,jdbcType=INTEGER}
39
+  </delete>
40
+  <insert id="insert" parameterType="com.community.huiju.model.TpActivity" >
41
+    insert into tp_activity (id, community_id, activity_title, 
42
+      activity_carousel_img, activity_content, sort, 
43
+      sign_up_count, sign_up_max, view_count, 
44
+      registration_start_time, registration_end_time, 
45
+      activity_start_time, activity_end_time, 
46
+      status, create_user, create_date, 
47
+      update_user, update_date)
48
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{activityTitle,jdbcType=VARCHAR}, 
49
+      #{activityCarouselImg,jdbcType=VARCHAR}, #{activityContent,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, 
50
+      #{signUpCount,jdbcType=INTEGER}, #{signUpMax,jdbcType=INTEGER}, #{viewCount,jdbcType=INTEGER}, 
51
+      #{registrationStartTime,jdbcType=TIMESTAMP}, #{registrationEndTime,jdbcType=TIMESTAMP}, 
52
+      #{activityStartTime,jdbcType=TIMESTAMP}, #{activityEndTime,jdbcType=TIMESTAMP}, 
53
+      #{status,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, 
54
+      #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP})
55
+  </insert>
56
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TpActivity" >
57
+    insert into tp_activity
58
+    <trim prefix="(" suffix=")" suffixOverrides="," >
59
+      <if test="id != null" >
60
+        id,
61
+      </if>
62
+      <if test="communityId != null" >
63
+        community_id,
64
+      </if>
65
+      <if test="activityTitle != null" >
66
+        activity_title,
67
+      </if>
68
+      <if test="activityCarouselImg != null" >
69
+        activity_carousel_img,
70
+      </if>
71
+      <if test="activityContent != null" >
72
+        activity_content,
73
+      </if>
74
+      <if test="sort != null" >
75
+        sort,
76
+      </if>
77
+      <if test="signUpCount != null" >
78
+        sign_up_count,
79
+      </if>
80
+      <if test="signUpMax != null" >
81
+        sign_up_max,
82
+      </if>
83
+      <if test="viewCount != null" >
84
+        view_count,
85
+      </if>
86
+      <if test="registrationStartTime != null" >
87
+        registration_start_time,
88
+      </if>
89
+      <if test="registrationEndTime != null" >
90
+        registration_end_time,
91
+      </if>
92
+      <if test="activityStartTime != null" >
93
+        activity_start_time,
94
+      </if>
95
+      <if test="activityEndTime != null" >
96
+        activity_end_time,
97
+      </if>
98
+      <if test="status != null" >
99
+        status,
100
+      </if>
101
+      <if test="createUser != null" >
102
+        create_user,
103
+      </if>
104
+      <if test="createDate != null" >
105
+        create_date,
106
+      </if>
107
+      <if test="updateUser != null" >
108
+        update_user,
109
+      </if>
110
+      <if test="updateDate != null" >
111
+        update_date,
112
+      </if>
113
+    </trim>
114
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
115
+      <if test="id != null" >
116
+        #{id,jdbcType=INTEGER},
117
+      </if>
118
+      <if test="communityId != null" >
119
+        #{communityId,jdbcType=INTEGER},
120
+      </if>
121
+      <if test="activityTitle != null" >
122
+        #{activityTitle,jdbcType=VARCHAR},
123
+      </if>
124
+      <if test="activityCarouselImg != null" >
125
+        #{activityCarouselImg,jdbcType=VARCHAR},
126
+      </if>
127
+      <if test="activityContent != null" >
128
+        #{activityContent,jdbcType=VARCHAR},
129
+      </if>
130
+      <if test="sort != null" >
131
+        #{sort,jdbcType=INTEGER},
132
+      </if>
133
+      <if test="signUpCount != null" >
134
+        #{signUpCount,jdbcType=INTEGER},
135
+      </if>
136
+      <if test="signUpMax != null" >
137
+        #{signUpMax,jdbcType=INTEGER},
138
+      </if>
139
+      <if test="viewCount != null" >
140
+        #{viewCount,jdbcType=INTEGER},
141
+      </if>
142
+      <if test="registrationStartTime != null" >
143
+        #{registrationStartTime,jdbcType=TIMESTAMP},
144
+      </if>
145
+      <if test="registrationEndTime != null" >
146
+        #{registrationEndTime,jdbcType=TIMESTAMP},
147
+      </if>
148
+      <if test="activityStartTime != null" >
149
+        #{activityStartTime,jdbcType=TIMESTAMP},
150
+      </if>
151
+      <if test="activityEndTime != null" >
152
+        #{activityEndTime,jdbcType=TIMESTAMP},
153
+      </if>
154
+      <if test="status != null" >
155
+        #{status,jdbcType=CHAR},
156
+      </if>
157
+      <if test="createUser != null" >
158
+        #{createUser,jdbcType=INTEGER},
159
+      </if>
160
+      <if test="createDate != null" >
161
+        #{createDate,jdbcType=TIMESTAMP},
162
+      </if>
163
+      <if test="updateUser != null" >
164
+        #{updateUser,jdbcType=INTEGER},
165
+      </if>
166
+      <if test="updateDate != null" >
167
+        #{updateDate,jdbcType=TIMESTAMP},
168
+      </if>
169
+    </trim>
170
+  </insert>
171
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpActivity" >
172
+    update tp_activity
173
+    <set >
174
+      <if test="communityId != null" >
175
+        community_id = #{communityId,jdbcType=INTEGER},
176
+      </if>
177
+      <if test="activityTitle != null" >
178
+        activity_title = #{activityTitle,jdbcType=VARCHAR},
179
+      </if>
180
+      <if test="activityCarouselImg != null" >
181
+        activity_carousel_img = #{activityCarouselImg,jdbcType=VARCHAR},
182
+      </if>
183
+      <if test="activityContent != null" >
184
+        activity_content = #{activityContent,jdbcType=VARCHAR},
185
+      </if>
186
+      <if test="sort != null" >
187
+        sort = #{sort,jdbcType=INTEGER},
188
+      </if>
189
+      <if test="signUpCount != null" >
190
+        sign_up_count = #{signUpCount,jdbcType=INTEGER},
191
+      </if>
192
+      <if test="signUpMax != null" >
193
+        sign_up_max = #{signUpMax,jdbcType=INTEGER},
194
+      </if>
195
+      <if test="viewCount != null" >
196
+        view_count = #{viewCount,jdbcType=INTEGER},
197
+      </if>
198
+      <if test="registrationStartTime != null" >
199
+        registration_start_time = #{registrationStartTime,jdbcType=TIMESTAMP},
200
+      </if>
201
+      <if test="registrationEndTime != null" >
202
+        registration_end_time = #{registrationEndTime,jdbcType=TIMESTAMP},
203
+      </if>
204
+      <if test="activityStartTime != null" >
205
+        activity_start_time = #{activityStartTime,jdbcType=TIMESTAMP},
206
+      </if>
207
+      <if test="activityEndTime != null" >
208
+        activity_end_time = #{activityEndTime,jdbcType=TIMESTAMP},
209
+      </if>
210
+      <if test="status != null" >
211
+        status = #{status,jdbcType=CHAR},
212
+      </if>
213
+      <if test="createUser != null" >
214
+        create_user = #{createUser,jdbcType=INTEGER},
215
+      </if>
216
+      <if test="createDate != null" >
217
+        create_date = #{createDate,jdbcType=TIMESTAMP},
218
+      </if>
219
+      <if test="updateUser != null" >
220
+        update_user = #{updateUser,jdbcType=INTEGER},
221
+      </if>
222
+      <if test="updateDate != null" >
223
+        update_date = #{updateDate,jdbcType=TIMESTAMP},
224
+      </if>
225
+    </set>
226
+    where id = #{id,jdbcType=INTEGER}
227
+  </update>
228
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpActivity" >
229
+    update tp_activity
230
+    set community_id = #{communityId,jdbcType=INTEGER},
231
+      activity_title = #{activityTitle,jdbcType=VARCHAR},
232
+      activity_carousel_img = #{activityCarouselImg,jdbcType=VARCHAR},
233
+      activity_content = #{activityContent,jdbcType=VARCHAR},
234
+      sort = #{sort,jdbcType=INTEGER},
235
+      sign_up_count = #{signUpCount,jdbcType=INTEGER},
236
+      sign_up_max = #{signUpMax,jdbcType=INTEGER},
237
+      view_count = #{viewCount,jdbcType=INTEGER},
238
+      registration_start_time = #{registrationStartTime,jdbcType=TIMESTAMP},
239
+      registration_end_time = #{registrationEndTime,jdbcType=TIMESTAMP},
240
+      activity_start_time = #{activityStartTime,jdbcType=TIMESTAMP},
241
+      activity_end_time = #{activityEndTime,jdbcType=TIMESTAMP},
242
+      status = #{status,jdbcType=CHAR},
243
+      create_user = #{createUser,jdbcType=INTEGER},
244
+      create_date = #{createDate,jdbcType=TIMESTAMP},
245
+      update_user = #{updateUser,jdbcType=INTEGER},
246
+      update_date = #{updateDate,jdbcType=TIMESTAMP}
247
+    where id = #{id,jdbcType=INTEGER}
248
+  </update>
249
+</mapper>

+ 189
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpAnnouncementMapper.xml Datei anzeigen

@@ -0,0 +1,189 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.TpAnnouncementMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TpAnnouncement" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="announcement_title" property="announcementTitle" jdbcType="VARCHAR" />
8
+    <result column="announcement_carousel_img" property="announcementCarouselImg" jdbcType="VARCHAR" />
9
+    <result column="announcement_content" property="announcementContent" jdbcType="VARCHAR" />
10
+    <result column="sort" property="sort" jdbcType="INTEGER" />
11
+    <result column="view_count" property="viewCount" jdbcType="INTEGER" />
12
+    <result column="set_up_carousel" property="setUpCarousel" jdbcType="CHAR" />
13
+    <result column="status" property="status" jdbcType="CHAR" />
14
+    <result column="create_user" property="createUser" jdbcType="INTEGER" />
15
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
16
+    <result column="update_user" property="updateUser" jdbcType="INTEGER" />
17
+    <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
18
+  </resultMap>
19
+  <sql id="Base_Column_List" >
20
+    id, community_id, announcement_title, announcement_carousel_img, announcement_content, 
21
+    sort, view_count, set_up_carousel, status, create_user, create_date, update_user, 
22
+    update_date
23
+  </sql>
24
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap">
25
+    select 
26
+    <include refid="Base_Column_List" />
27
+    from tp_announcement
28
+    where id = #{id,jdbcType=INTEGER} and community_id = #{communityId,jdbcType=INTEGER}
29
+  </select>
30
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
31
+    delete from tp_announcement
32
+    where id = #{id,jdbcType=INTEGER}
33
+  </delete>
34
+  <insert id="insert" parameterType="com.community.huiju.model.TpAnnouncement" >
35
+    insert into tp_announcement (id, community_id, announcement_title, 
36
+      announcement_carousel_img, announcement_content, 
37
+      sort, view_count, set_up_carousel, 
38
+      status, create_user, create_date, 
39
+      update_user, update_date)
40
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{announcementTitle,jdbcType=VARCHAR}, 
41
+      #{announcementCarouselImg,jdbcType=VARCHAR}, #{announcementContent,jdbcType=VARCHAR}, 
42
+      #{sort,jdbcType=INTEGER}, #{viewCount,jdbcType=INTEGER}, #{setUpCarousel,jdbcType=CHAR}, 
43
+      #{status,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, 
44
+      #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP})
45
+  </insert>
46
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TpAnnouncement" >
47
+    insert into tp_announcement
48
+    <trim prefix="(" suffix=")" suffixOverrides="," >
49
+      <if test="id != null" >
50
+        id,
51
+      </if>
52
+      <if test="communityId != null" >
53
+        community_id,
54
+      </if>
55
+      <if test="announcementTitle != null" >
56
+        announcement_title,
57
+      </if>
58
+      <if test="announcementCarouselImg != null" >
59
+        announcement_carousel_img,
60
+      </if>
61
+      <if test="announcementContent != null" >
62
+        announcement_content,
63
+      </if>
64
+      <if test="sort != null" >
65
+        sort,
66
+      </if>
67
+      <if test="viewCount != null" >
68
+        view_count,
69
+      </if>
70
+      <if test="setUpCarousel != null" >
71
+        set_up_carousel,
72
+      </if>
73
+      <if test="status != null" >
74
+        status,
75
+      </if>
76
+      <if test="createUser != null" >
77
+        create_user,
78
+      </if>
79
+      <if test="createDate != null" >
80
+        create_date,
81
+      </if>
82
+      <if test="updateUser != null" >
83
+        update_user,
84
+      </if>
85
+      <if test="updateDate != null" >
86
+        update_date,
87
+      </if>
88
+    </trim>
89
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
90
+      <if test="id != null" >
91
+        #{id,jdbcType=INTEGER},
92
+      </if>
93
+      <if test="communityId != null" >
94
+        #{communityId,jdbcType=INTEGER},
95
+      </if>
96
+      <if test="announcementTitle != null" >
97
+        #{announcementTitle,jdbcType=VARCHAR},
98
+      </if>
99
+      <if test="announcementCarouselImg != null" >
100
+        #{announcementCarouselImg,jdbcType=VARCHAR},
101
+      </if>
102
+      <if test="announcementContent != null" >
103
+        #{announcementContent,jdbcType=VARCHAR},
104
+      </if>
105
+      <if test="sort != null" >
106
+        #{sort,jdbcType=INTEGER},
107
+      </if>
108
+      <if test="viewCount != null" >
109
+        #{viewCount,jdbcType=INTEGER},
110
+      </if>
111
+      <if test="setUpCarousel != null" >
112
+        #{setUpCarousel,jdbcType=CHAR},
113
+      </if>
114
+      <if test="status != null" >
115
+        #{status,jdbcType=CHAR},
116
+      </if>
117
+      <if test="createUser != null" >
118
+        #{createUser,jdbcType=INTEGER},
119
+      </if>
120
+      <if test="createDate != null" >
121
+        #{createDate,jdbcType=TIMESTAMP},
122
+      </if>
123
+      <if test="updateUser != null" >
124
+        #{updateUser,jdbcType=INTEGER},
125
+      </if>
126
+      <if test="updateDate != null" >
127
+        #{updateDate,jdbcType=TIMESTAMP},
128
+      </if>
129
+    </trim>
130
+  </insert>
131
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpAnnouncement" >
132
+    update tp_announcement
133
+    <set >
134
+      <if test="communityId != null" >
135
+        community_id = #{communityId,jdbcType=INTEGER},
136
+      </if>
137
+      <if test="announcementTitle != null" >
138
+        announcement_title = #{announcementTitle,jdbcType=VARCHAR},
139
+      </if>
140
+      <if test="announcementCarouselImg != null" >
141
+        announcement_carousel_img = #{announcementCarouselImg,jdbcType=VARCHAR},
142
+      </if>
143
+      <if test="announcementContent != null" >
144
+        announcement_content = #{announcementContent,jdbcType=VARCHAR},
145
+      </if>
146
+      <if test="sort != null" >
147
+        sort = #{sort,jdbcType=INTEGER},
148
+      </if>
149
+      <if test="viewCount != null" >
150
+        view_count = #{viewCount,jdbcType=INTEGER},
151
+      </if>
152
+      <if test="setUpCarousel != null" >
153
+        set_up_carousel = #{setUpCarousel,jdbcType=CHAR},
154
+      </if>
155
+      <if test="status != null" >
156
+        status = #{status,jdbcType=CHAR},
157
+      </if>
158
+      <if test="createUser != null" >
159
+        create_user = #{createUser,jdbcType=INTEGER},
160
+      </if>
161
+      <if test="createDate != null" >
162
+        create_date = #{createDate,jdbcType=TIMESTAMP},
163
+      </if>
164
+      <if test="updateUser != null" >
165
+        update_user = #{updateUser,jdbcType=INTEGER},
166
+      </if>
167
+      <if test="updateDate != null" >
168
+        update_date = #{updateDate,jdbcType=TIMESTAMP},
169
+      </if>
170
+    </set>
171
+    where id = #{id,jdbcType=INTEGER}
172
+  </update>
173
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpAnnouncement" >
174
+    update tp_announcement
175
+    set community_id = #{communityId,jdbcType=INTEGER},
176
+      announcement_title = #{announcementTitle,jdbcType=VARCHAR},
177
+      announcement_carousel_img = #{announcementCarouselImg,jdbcType=VARCHAR},
178
+      announcement_content = #{announcementContent,jdbcType=VARCHAR},
179
+      sort = #{sort,jdbcType=INTEGER},
180
+      view_count = #{viewCount,jdbcType=INTEGER},
181
+      set_up_carousel = #{setUpCarousel,jdbcType=CHAR},
182
+      status = #{status,jdbcType=CHAR},
183
+      create_user = #{createUser,jdbcType=INTEGER},
184
+      create_date = #{createDate,jdbcType=TIMESTAMP},
185
+      update_user = #{updateUser,jdbcType=INTEGER},
186
+      update_date = #{updateDate,jdbcType=TIMESTAMP}
187
+    where id = #{id,jdbcType=INTEGER}
188
+  </update>
189
+</mapper>

+ 16
- 1
CODE/smart-community/app-api/src/main/resources/mapper/TpMessageMapper.xml Datei anzeigen

@@ -233,7 +233,7 @@
233 233
     where id = #{id,jdbcType=INTEGER}
234 234
   </update>
235 235
 
236
-  <select id="getMessageTotal" resultType="map" parameterType="java.lang.Integer" >
236
+  <select id="getMessageTotal" resultType="map">
237 237
     SELECT
238 238
         count( CASE WHEN model_type = 1 AND read_status = 0 THEN 1 ELSE NULL END ) AS messageTotal,
239 239
         count( CASE WHEN model_type = 2 THEN 1 ELSE NULL END ) AS toDoTotal
@@ -241,8 +241,23 @@
241 241
         tp_message
242 242
     WHERE
243 243
         uuid_type = 1
244
+        AND community_id = #{communityId,jdbcType=INTEGER}
244 245
         AND uuid = #{userId,jdbcType=INTEGER}
245 246
         AND STATUS = 1
246 247
         AND advice_type = 1
247 248
   </select>
249
+
250
+  <select id="getMessages" resultMap="BaseResultMap">
251
+    SELECT
252
+      <include refid="Base_Column_List" />
253
+    FROM
254
+        tp_message
255
+    WHERE
256
+        uuid_type = 1
257
+        AND community_id = #{communityId,jdbcType=INTEGER}
258
+        AND uuid = #{userId,jdbcType=INTEGER}
259
+        AND STATUS = 1
260
+        AND advice_type = 1
261
+        AND model_type = #{modelType,jdbcType=INTEGER}
262
+  </select>
248 263
 </mapper>

+ 5
- 0
CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java Datei anzeigen

@@ -30,5 +30,10 @@ public class Constant {
30 30
     /** 本地緩存最大个数 **/
31 31
     public static final Long CACHE_SIZE = 1000L;
32 32
 
33
+    /** 住户APP端消息 **/
34
+    public static final Integer MODEL_TYPE_NEWS = 1;
35
+    
36
+    /** 住户APP端待办 **/
37
+    public static final Integer MODEL_TYPE_UPCOMING = 2;
33 38
 
34 39
 }

+ 289
- 277
文档/MYSQL/smartCommunity.pdb
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 289
- 277
文档/MYSQL/smartCommunity.pdm
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen