魏熙美 vor 6 Jahren
Ursprung
Commit
e605f33d58

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

@@ -0,0 +1,28 @@
1
+package com.community.huiju.dao;
2
+
3
+
4
+import com.community.huiju.model.TaUserVerify;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.List;
8
+
9
+public interface TaUserVerifyMapper {
10
+    int deleteByPrimaryKey(Integer id);
11
+
12
+    int insert(TaUserVerify record);
13
+
14
+    int insertSelective(TaUserVerify record);
15
+
16
+    TaUserVerify selectByPrimaryKey(Integer id);
17
+
18
+    int updateByPrimaryKeySelective(TaUserVerify record);
19
+
20
+    int updateByPrimaryKey(TaUserVerify record);
21
+
22
+    /**
23
+     * 根据 用户id 查询房产
24
+     * @param userId
25
+     * @return
26
+     */
27
+    List<TaUserVerify> selectByUserId(@Param("userId") Integer userId);
28
+}

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

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

+ 0
- 45
CODE/smart-community/app-api/src/main/java/com/community/huiju/enums/BuildingOwnerInfoEnum.java Datei anzeigen

@@ -1,45 +0,0 @@
1
-package com.community.huiju.enums;
2
-
3
-
4
-/**
5
- * 楼栋资料库 枚举
6
- * @author weiximei
7
- */
8
-public enum BuildingOwnerInfoEnum {
9
-
10
-    NO_AUDIT_REAL_ESTATE(0, "无关联房产"),
11
-
12
-    A_AUDIT_REAL_ESTATE(1, "关联一个审核通过的房产"),
13
-
14
-    A_TO_AUDIT_REAL_ESTATE(2, "关联一个待审核房产"),
15
-
16
-    A_AUDIT_FAILED_REAL_ESTATE(3, "关联一个审核未通过房产"),
17
-
18
-    A_MULTIPLE_REAL_ESTATE(3, "有多个关联房产"),
19
-
20
-    ;
21
-
22
-    BuildingOwnerInfoEnum(Integer code, String msg) {
23
-        this.code = code;
24
-        this.msg = msg;
25
-    }
26
-
27
-    private Integer code;
28
-
29
-    private String msg;
30
-
31
-    public Integer getCode() {
32
-        return code;
33
-    }
34
-
35
-    public void setCode(Integer code) {
36
-        this.code = code;
37
-    }
38
-
39
-    public String getMsg() {
40
-        return msg;
41
-    }
42
-
43
-    public void setMsg(String msg) {
44
-        this.msg = msg;
45
-    }}

+ 67
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/enums/UserVerifyEnum.java Datei anzeigen

@@ -0,0 +1,67 @@
1
+package com.community.huiju.enums;
2
+
3
+
4
+/**
5
+ * 楼栋资料库 枚举
6
+ * @author weiximei
7
+ */
8
+public enum UserVerifyEnum {
9
+
10
+    NO_AUDIT_REAL_ESTATE("1000", "无关联房产"),
11
+
12
+    A_AUDIT_REAL_ESTATE("1001", "关联一个审核通过的房产"),
13
+
14
+    A_TO_AUDIT_REAL_ESTATE("1002", "关联一个待审核房产"),
15
+
16
+    A_AUDIT_FAILED_REAL_ESTATE("1003", "关联一个审核未通过房产"),
17
+
18
+    A_MULTIPLE_REAL_ESTATE("1004", "有多个关联房产"),
19
+
20
+    ;
21
+
22
+    UserVerifyEnum(String code, String msg) {
23
+        this.code = code;
24
+        this.msg = msg;
25
+    }
26
+
27
+    private String code;
28
+
29
+    private String msg;
30
+
31
+    public String getCode() {
32
+        return code;
33
+    }
34
+
35
+    public void setCode(String code) {
36
+        this.code = code;
37
+    }
38
+
39
+    public String getMsg() {
40
+        return msg;
41
+    }
42
+
43
+    public void setMsg(String msg) {
44
+        this.msg = msg;
45
+    }
46
+
47
+
48
+    public static String getMsg(String code) {
49
+        String message = "";
50
+        if ("1000".equals(code)) {
51
+            message = NO_AUDIT_REAL_ESTATE.getMsg();
52
+        } else if ("1001".equals(code)) {
53
+            message = A_AUDIT_REAL_ESTATE.getMsg();
54
+        } else if ("1002".equals(code)) {
55
+            message = A_TO_AUDIT_REAL_ESTATE.getMsg();
56
+        } else if ("1003".equals(code)) {
57
+            message = A_AUDIT_FAILED_REAL_ESTATE.getMsg();
58
+        } else if ("1004".equals(code)) {
59
+            message = A_MULTIPLE_REAL_ESTATE.getMsg();
60
+        }
61
+
62
+        return message;
63
+    }
64
+
65
+}
66
+
67
+

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

@@ -0,0 +1,135 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class TaUserVerify {
6
+    private Integer id;
7
+
8
+    private Integer userId;
9
+
10
+    private Integer communityId;
11
+
12
+    private Integer roleId;
13
+
14
+    private String phase;
15
+
16
+    private String building;
17
+
18
+    private String unit;
19
+
20
+    private String level;
21
+
22
+    private String roomNo;
23
+
24
+    private String verifyStatus;
25
+
26
+    private String openid;
27
+
28
+    private String nickname;
29
+
30
+    private Date createDate;
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 getUserId() {
41
+        return userId;
42
+    }
43
+
44
+    public void setUserId(Integer userId) {
45
+        this.userId = userId;
46
+    }
47
+
48
+    public Integer getCommunityId() {
49
+        return communityId;
50
+    }
51
+
52
+    public void setCommunityId(Integer communityId) {
53
+        this.communityId = communityId;
54
+    }
55
+
56
+    public Integer getRoleId() {
57
+        return roleId;
58
+    }
59
+
60
+    public void setRoleId(Integer roleId) {
61
+        this.roleId = roleId;
62
+    }
63
+
64
+    public String getPhase() {
65
+        return phase;
66
+    }
67
+
68
+    public void setPhase(String phase) {
69
+        this.phase = phase == null ? null : phase.trim();
70
+    }
71
+
72
+    public String getBuilding() {
73
+        return building;
74
+    }
75
+
76
+    public void setBuilding(String building) {
77
+        this.building = building == null ? null : building.trim();
78
+    }
79
+
80
+    public String getUnit() {
81
+        return unit;
82
+    }
83
+
84
+    public void setUnit(String unit) {
85
+        this.unit = unit == null ? null : unit.trim();
86
+    }
87
+
88
+    public String getLevel() {
89
+        return level;
90
+    }
91
+
92
+    public void setLevel(String level) {
93
+        this.level = level == null ? null : level.trim();
94
+    }
95
+
96
+    public String getRoomNo() {
97
+        return roomNo;
98
+    }
99
+
100
+    public void setRoomNo(String roomNo) {
101
+        this.roomNo = roomNo == null ? null : roomNo.trim();
102
+    }
103
+
104
+    public String getVerifyStatus() {
105
+        return verifyStatus;
106
+    }
107
+
108
+    public void setVerifyStatus(String verifyStatus) {
109
+        this.verifyStatus = verifyStatus == null ? null : verifyStatus.trim();
110
+    }
111
+
112
+    public String getOpenid() {
113
+        return openid;
114
+    }
115
+
116
+    public void setOpenid(String openid) {
117
+        this.openid = openid == null ? null : openid.trim();
118
+    }
119
+
120
+    public String getNickname() {
121
+        return nickname;
122
+    }
123
+
124
+    public void setNickname(String nickname) {
125
+        this.nickname = nickname == null ? null : nickname.trim();
126
+    }
127
+
128
+    public Date getCreateDate() {
129
+        return createDate;
130
+    }
131
+
132
+    public void setCreateDate(Date createDate) {
133
+        this.createDate = createDate;
134
+    }
135
+}

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

@@ -0,0 +1,85 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class TpBuilding {
6
+    private Integer id;
7
+
8
+    private Integer communityId;
9
+
10
+    private String phase;
11
+
12
+    private String building;
13
+
14
+    private String unit;
15
+
16
+    private String level;
17
+
18
+    private String roomNo;
19
+
20
+    private Date createDate;
21
+
22
+    public Integer getId() {
23
+        return id;
24
+    }
25
+
26
+    public void setId(Integer id) {
27
+        this.id = id;
28
+    }
29
+
30
+    public Integer getCommunityId() {
31
+        return communityId;
32
+    }
33
+
34
+    public void setCommunityId(Integer communityId) {
35
+        this.communityId = communityId;
36
+    }
37
+
38
+    public String getPhase() {
39
+        return phase;
40
+    }
41
+
42
+    public void setPhase(String phase) {
43
+        this.phase = phase == null ? null : phase.trim();
44
+    }
45
+
46
+    public String getBuilding() {
47
+        return building;
48
+    }
49
+
50
+    public void setBuilding(String building) {
51
+        this.building = building == null ? null : building.trim();
52
+    }
53
+
54
+    public String getUnit() {
55
+        return unit;
56
+    }
57
+
58
+    public void setUnit(String unit) {
59
+        this.unit = unit == null ? null : unit.trim();
60
+    }
61
+
62
+    public String getLevel() {
63
+        return level;
64
+    }
65
+
66
+    public void setLevel(String level) {
67
+        this.level = level == null ? null : level.trim();
68
+    }
69
+
70
+    public String getRoomNo() {
71
+        return roomNo;
72
+    }
73
+
74
+    public void setRoomNo(String roomNo) {
75
+        this.roomNo = roomNo == null ? null : roomNo.trim();
76
+    }
77
+
78
+    public Date getCreateDate() {
79
+        return createDate;
80
+    }
81
+
82
+    public void setCreateDate(Date createDate) {
83
+        this.createDate = createDate;
84
+    }
85
+}

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

@@ -36,10 +36,10 @@ public interface ITaUserService {
36 36
 
37 37
     /**
38 38
      * 注册用户
39
-     * @param user
39
+     * @param parameter
40 40
      * @return 用户对象
41 41
      */
42
-    ResponseBean register(TaUser user);
42
+    ResponseBean register(String parameter);
43 43
 
44 44
     /**
45 45
      * 修改当前用户手机号

+ 72
- 91
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java Datei anzeigen

@@ -16,6 +16,7 @@ import com.community.huiju.common.hk.HKOpenApi;
16 16
 import com.community.huiju.common.welcome.OkHttpRequestUtils;
17 17
 import com.community.huiju.common.welcome.WelcomeProperties;
18 18
 import com.community.huiju.dao.*;
19
+import com.community.huiju.enums.UserVerifyEnum;
19 20
 import com.community.huiju.exception.WisdomException;
20 21
 import com.community.huiju.model.*;
21 22
 import com.community.huiju.service.ITaUserService;
@@ -95,6 +96,9 @@ public class TaUserServiceImpl implements ITaUserService {
95 96
     @Qualifier("phoneCodeImpl")
96 97
     private ICode iCode;
97 98
 
99
+    @Autowired
100
+    private TaUserVerifyMapper taUserVerifyMapper;
101
+
98 102
     @Override
99 103
     @Transactional(rollbackFor = Exception.class)
100 104
     public ResponseBean login(String loginName,String code) {
@@ -114,33 +118,81 @@ public class TaUserServiceImpl implements ITaUserService {
114 118
         // 校验用户
115 119
         checkVerifyStatusUser(currentUser);
116 120
 
117
-        // TODO 校验房产
118 121
         // 校验房产
119
-
120
-
122
+        List<TaUserVerify> taUserVerifies = taUserVerifyMapper.selectByUserId(currentUser.getId());
123
+        // 无关联房产
124
+        if (null == taUserVerifies || taUserVerifies.size() == 0) {
125
+            response.addSuccess(UserVerifyEnum.NO_AUDIT_REAL_ESTATE.getCode(), UserVerifyEnum.NO_AUDIT_REAL_ESTATE.getMsg());
126
+            return response;
127
+        }
121 128
         TaUserVO taUserVO = new TaUserVO();
122
-        BeanUtils.copyProperties(currentUser, taUserVO);
123
-        response.addSuccess(taUserVO);
129
+        // 关联一个审核通过的房产/关联一个待审核房产/关联一个审核未通过房产
130
+        if (taUserVerifies.size() == 1) {
131
+            BeanUtils.copyProperties(currentUser, taUserVO);
132
+            // 认证状态  0 是未审核   1是审核通过   2是审核不通过
133
+            String verifyStatus = taUserVerifies.get(0).getVerifyStatus();
134
+            // 有一个审核通过的房产
135
+            if ("0".equals(verifyStatus)) {
136
+
137
+                TaUserVerify userVerify = taUserVerifies.get(0);
138
+                // 设置 userVO 信息
139
+                setUserVoProperties(userVerify.getCommunityId(), taUserVO);
140
+
141
+                taUserVO.setAddressBuilding(userVerify.getPhase() + userVerify.getBuilding() + userVerify.getUnit() + userVerify.getLevel() + userVerify.getRoomNo());
142
+                TaSysRole taSysRole = taSysRoleMapper.selectByPrimaryKey(userVerify.getRoleId());
143
+                taUserVO.setRole(taSysRole.getRoleName());
144
+
145
+                response.addSuccess(taUserVO);
146
+                return response;
147
+            }
148
+            String resultCode = "1".equals(verifyStatus) ? UserVerifyEnum.A_AUDIT_REAL_ESTATE.getCode() :
149
+                                "2".equals(verifyStatus) ? UserVerifyEnum.A_AUDIT_FAILED_REAL_ESTATE.getCode() : "500";
150
+            response.addSuccess(resultCode, taUserVO);
151
+            return response;
152
+        } else if (taUserVerifies.size() >= 2) {
153
+            BeanUtils.copyProperties(currentUser, taUserVO);
154
+            response.addSuccess(UserVerifyEnum.A_MULTIPLE_REAL_ESTATE.getCode(), taUserVO);
155
+            return response;
156
+        }
157
+
124 158
         return response;
125 159
     }
126 160
 
161
+    /**
162
+     * 设置 TaUserVO 的一些信息
163
+     *
164
+     *      小区,省市区
165
+     *
166
+     * @param communityId
167
+     * @param userVO
168
+     */
169
+    private void setUserVoProperties(Integer communityId, TaUserVO userVO) {
170
+        // 获取小区
171
+        ToCommunities toCommunities = toCommunitiesMapper.selectByPrimaryKey(communityId);
172
+        // 省
173
+        SysNation province = sysNationMapper.selectByPrimaryKey(toCommunities.getProvinceId());
174
+        // 市
175
+        SysNation city = sysNationMapper.selectByPrimaryKey(toCommunities.getCityId());
176
+        // 区
177
+        SysNation district = sysNationMapper.selectByPrimaryKey(toCommunities.getDistrictId());
178
+
179
+        userVO.setAddressProvince(province.getProvince()+""+city.getCity()+""+district.getDistrict() + toCommunities.getCommunityName());
180
+        userVO.setCommunityId(communityId);
181
+        userVO.setCommunityName(toCommunities.getCommunityName());
182
+    }
183
+
127 184
     @Transactional(rollbackFor = Exception.class)
128 185
     @Override
129
-    public ResponseBean register(TaUser user) {
186
+    public ResponseBean register(String parameter) {
187
+        ResponseBean<TaUser> response = new ResponseBean();
188
+        JSONObject jsonObject = JSONObject.parseObject(parameter);
189
+        TaUser user = jsonObject.toJavaObject(TaUser.class);
190
+        String code = jsonObject.getString("code");
130 191
 
131
-        // TODO 注册逻辑需要完善
132
-        /**
133
-         * 1.自动生成账号的基本信息
134
-         * 2.匹配资料库 已认证 未认证
135
-         * 2.角色类型
136
-         *
137
-         * 具体看原型图
138
-         *
139
-         */
192
+        // 校验手机号 和验证码
193
+        iCode.checkPhoneAndCode(user.getLoginName(), code);
140 194
 
141
-        ResponseBean<TaUserVO> response = new ResponseBean();
142 195
         // 开始注册
143
-        user.setHkPersonNo(idGen.nextId());
144 196
         user.setCreateDate(new Date());
145 197
         user.setUpdateDate(new Date());
146 198
         user.setStatus("1");
@@ -149,74 +201,14 @@ public class TaUserServiceImpl implements ITaUserService {
149 201
         user.setRemark("这是系统自动注册!");
150 202
         user.setVerifyStatus("0");
151 203
         user.setFaceStatus("0");
152
-        //user.setLoginPassword(MD5Utils.encode(user.getLoginPassword()));
153
-        // 0表示 未选择性别
154
-        user.setGender("0");
155 204
         taUserMapper.insertSelective(user);
156 205
 
157 206
         user.setCreateUser(user.getId());
158 207
         user.setUpdateUser(user.getId());
159 208
 
160
-        // 这里先默认 type=4 (未认证)
161
-        int roleType = 4;
162
-
163
-        // 查询资料库
164
-        // TODO 这里默认List接收, 后期会有多个小区认证,可能会返回多条
165
-        List<TpBuildingOwnerInfo> buildingOwnerInfoList = tpBuildingOwnerInfoMapper.getByCommunityIdAndOwnerTel(user.getCommunityId(), user.getLoginName());
166
-        if (CollectionUtils.isNotEmpty(buildingOwnerInfoList)) {
167
-            // TODO 目前是一个业主对应单个小区, 所以取第一个
168
-            TpBuildingOwnerInfo buildingOwnerInfo = buildingOwnerInfoList.get(0);
169
-            user.setBuildingOwnerInfoId(buildingOwnerInfo.getId());
170
-            user.setVerifyStatus("1");
171
-            user.setUserName(buildingOwnerInfo.getOwnerName());
172
-            // 标记位1, 业主身份
173
-            roleType = 1;
174
-
175
-            // 更新资料库的关联状态 和 认证状态
176
-            buildingOwnerInfo.setVerifyStatus("1");
177
-            buildingOwnerInfo.setPairStatus("1");
178
-            buildingOwnerInfo.setUpdateDate(new Date());
179
-            tpBuildingOwnerInfoMapper.updateByPrimaryKeySelective(buildingOwnerInfo);
180
-
181
-            // 开始绑定缴费单
182
-            List<TpBillInvoice> tpBillInvoices = tpBillInvoiceMapper.selectByBuildingOwnerInfoId(buildingOwnerInfo.getId());
183
-            if (CollectionUtils.isNotEmpty(tpBillInvoices)) {
184
-                Map<String, Object> map = new HashMap<>();
185
-                map.put("taUserId", user.getId());
186
-                map.put("list", tpBillInvoices);
187
-                tpBillInvoiceMapper.updateBeach(map);
188
-            }
189
-
190
-        }
191
-
192 209
         // 更新
193 210
         taUserMapper.updateByPrimaryKeySelective(user);
194
-
195
-        // 这里默认 roleType=4 (未认证),  资料库认证后, 变为 1 (业主)
196
-        // 资料库已经对接, 新注册的默认为 未认证, 只有匹配了资料库后才是业主
197
-        addOrUpdateUserRole(roleType,response,user,true);
198
-
199
-
200
-        // 推送海康
201
-        /**
202
-         * 1.获取部门(比如 住户)
203
-         * 2.根据部门编号推送 海康
204
-         */
205
-        addUserAndOpenCard(response,user);
206
-
207
-        // 给用户添加 海康门禁权限
208
-        HKOpenApi.addAuthoritiesByPersonIds(String.valueOf(user.getHkUserId()));
209
-
210
-        // 下发门禁权限
211
-        HKOpenApi.downloadAuthorityByDeviceUuids();
212
-
213
-        //--------- 可视对讲 ----------
214
-        visualIntercom(user);
215
-
216
-
217
-        TaUserVO taUserVO = new TaUserVO();
218
-        BeanUtils.copyProperties(user,taUserVO);
219
-        response.addSuccess(taUserVO);
211
+        response.addSuccess(user);
220 212
         return response;
221 213
     }
222 214
 
@@ -885,19 +877,8 @@ public class TaUserServiceImpl implements ITaUserService {
885 877
                     +tpBuildingOwnerInfo.getRoomNo());
886 878
         }
887 879
 
888
-
889
-        // 获取小区
890
-        ToCommunities toCommunities = toCommunitiesMapper.selectByPrimaryKey(user.getCommunityId());
891
-
892
-        // 省
893
-        SysNation province = sysNationMapper.selectByPrimaryKey(toCommunities.getProvinceId());
894
-        // 市
895
-        SysNation city = sysNationMapper.selectByPrimaryKey(toCommunities.getCityId());
896
-        // 区
897
-        SysNation district = sysNationMapper.selectByPrimaryKey(toCommunities.getDistrictId());
898
-
899
-        userVO.setAddressProvince(province.getProvince()+""+city.getCity()+""+district.getDistrict() + toCommunities.getCommunityName());
900
-        userVO.setCommunityName(toCommunities.getCommunityName());
880
+        // 设置 userVO 一些信息
881
+        setUserVoProperties(user.getCommunityId(), userVO);
901 882
 
902 883
         // 角色
903 884
         TaSysRole taSysRole = taSysRoleMapper.findRoleByUserId(user.getId());

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

@@ -0,0 +1,194 @@
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.TaUserVerifyMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TaUserVerify" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="user_id" property="userId" jdbcType="INTEGER" />
7
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
8
+    <result column="role_id" property="roleId" jdbcType="INTEGER" />
9
+    <result column="phase" property="phase" jdbcType="VARCHAR" />
10
+    <result column="building" property="building" jdbcType="VARCHAR" />
11
+    <result column="unit" property="unit" jdbcType="VARCHAR" />
12
+    <result column="level" property="level" jdbcType="VARCHAR" />
13
+    <result column="room_no" property="roomNo" jdbcType="VARCHAR" />
14
+    <result column="verify_status" property="verifyStatus" jdbcType="VARCHAR" />
15
+    <result column="openid" property="openid" jdbcType="VARCHAR" />
16
+    <result column="nickname" property="nickname" jdbcType="VARCHAR" />
17
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
18
+  </resultMap>
19
+  <sql id="Base_Column_List" >
20
+    id, user_id, community_id, role_id, phase, building, unit, level, room_no, verify_status, 
21
+    openid, nickname, create_date
22
+  </sql>
23
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
24
+    select 
25
+    <include refid="Base_Column_List" />
26
+    from ta_user_verify
27
+    where id = #{id,jdbcType=INTEGER}
28
+  </select>
29
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
30
+    delete from ta_user_verify
31
+    where id = #{id,jdbcType=INTEGER}
32
+  </delete>
33
+  <insert id="insert" parameterType="com.community.huiju.model.TaUserVerify" >
34
+    insert into ta_user_verify (id, user_id, community_id, 
35
+      role_id, phase, building, 
36
+      unit, level, room_no, 
37
+      verify_status, openid, nickname, 
38
+      create_date)
39
+    values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, 
40
+      #{roleId,jdbcType=INTEGER}, #{phase,jdbcType=VARCHAR}, #{building,jdbcType=VARCHAR}, 
41
+      #{unit,jdbcType=VARCHAR}, #{level,jdbcType=VARCHAR}, #{roomNo,jdbcType=VARCHAR}, 
42
+      #{verifyStatus,jdbcType=VARCHAR}, #{openid,jdbcType=VARCHAR}, #{nickname,jdbcType=VARCHAR}, 
43
+      #{createDate,jdbcType=TIMESTAMP})
44
+  </insert>
45
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TaUserVerify" >
46
+    insert into ta_user_verify
47
+    <trim prefix="(" suffix=")" suffixOverrides="," >
48
+      <if test="id != null" >
49
+        id,
50
+      </if>
51
+      <if test="userId != null" >
52
+        user_id,
53
+      </if>
54
+      <if test="communityId != null" >
55
+        community_id,
56
+      </if>
57
+      <if test="roleId != null" >
58
+        role_id,
59
+      </if>
60
+      <if test="phase != null" >
61
+        phase,
62
+      </if>
63
+      <if test="building != null" >
64
+        building,
65
+      </if>
66
+      <if test="unit != null" >
67
+        unit,
68
+      </if>
69
+      <if test="level != null" >
70
+        level,
71
+      </if>
72
+      <if test="roomNo != null" >
73
+        room_no,
74
+      </if>
75
+      <if test="verifyStatus != null" >
76
+        verify_status,
77
+      </if>
78
+      <if test="openid != null" >
79
+        openid,
80
+      </if>
81
+      <if test="nickname != null" >
82
+        nickname,
83
+      </if>
84
+      <if test="createDate != null" >
85
+        create_date,
86
+      </if>
87
+    </trim>
88
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
89
+      <if test="id != null" >
90
+        #{id,jdbcType=INTEGER},
91
+      </if>
92
+      <if test="userId != null" >
93
+        #{userId,jdbcType=INTEGER},
94
+      </if>
95
+      <if test="communityId != null" >
96
+        #{communityId,jdbcType=INTEGER},
97
+      </if>
98
+      <if test="roleId != null" >
99
+        #{roleId,jdbcType=INTEGER},
100
+      </if>
101
+      <if test="phase != null" >
102
+        #{phase,jdbcType=VARCHAR},
103
+      </if>
104
+      <if test="building != null" >
105
+        #{building,jdbcType=VARCHAR},
106
+      </if>
107
+      <if test="unit != null" >
108
+        #{unit,jdbcType=VARCHAR},
109
+      </if>
110
+      <if test="level != null" >
111
+        #{level,jdbcType=VARCHAR},
112
+      </if>
113
+      <if test="roomNo != null" >
114
+        #{roomNo,jdbcType=VARCHAR},
115
+      </if>
116
+      <if test="verifyStatus != null" >
117
+        #{verifyStatus,jdbcType=VARCHAR},
118
+      </if>
119
+      <if test="openid != null" >
120
+        #{openid,jdbcType=VARCHAR},
121
+      </if>
122
+      <if test="nickname != null" >
123
+        #{nickname,jdbcType=VARCHAR},
124
+      </if>
125
+      <if test="createDate != null" >
126
+        #{createDate,jdbcType=TIMESTAMP},
127
+      </if>
128
+    </trim>
129
+  </insert>
130
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TaUserVerify" >
131
+    update ta_user_verify
132
+    <set >
133
+      <if test="userId != null" >
134
+        user_id = #{userId,jdbcType=INTEGER},
135
+      </if>
136
+      <if test="communityId != null" >
137
+        community_id = #{communityId,jdbcType=INTEGER},
138
+      </if>
139
+      <if test="roleId != null" >
140
+        role_id = #{roleId,jdbcType=INTEGER},
141
+      </if>
142
+      <if test="phase != null" >
143
+        phase = #{phase,jdbcType=VARCHAR},
144
+      </if>
145
+      <if test="building != null" >
146
+        building = #{building,jdbcType=VARCHAR},
147
+      </if>
148
+      <if test="unit != null" >
149
+        unit = #{unit,jdbcType=VARCHAR},
150
+      </if>
151
+      <if test="level != null" >
152
+        level = #{level,jdbcType=VARCHAR},
153
+      </if>
154
+      <if test="roomNo != null" >
155
+        room_no = #{roomNo,jdbcType=VARCHAR},
156
+      </if>
157
+      <if test="verifyStatus != null" >
158
+        verify_status = #{verifyStatus,jdbcType=VARCHAR},
159
+      </if>
160
+      <if test="openid != null" >
161
+        openid = #{openid,jdbcType=VARCHAR},
162
+      </if>
163
+      <if test="nickname != null" >
164
+        nickname = #{nickname,jdbcType=VARCHAR},
165
+      </if>
166
+      <if test="createDate != null" >
167
+        create_date = #{createDate,jdbcType=TIMESTAMP},
168
+      </if>
169
+    </set>
170
+    where id = #{id,jdbcType=INTEGER}
171
+  </update>
172
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TaUserVerify" >
173
+    update ta_user_verify
174
+    set user_id = #{userId,jdbcType=INTEGER},
175
+      community_id = #{communityId,jdbcType=INTEGER},
176
+      role_id = #{roleId,jdbcType=INTEGER},
177
+      phase = #{phase,jdbcType=VARCHAR},
178
+      building = #{building,jdbcType=VARCHAR},
179
+      unit = #{unit,jdbcType=VARCHAR},
180
+      level = #{level,jdbcType=VARCHAR},
181
+      room_no = #{roomNo,jdbcType=VARCHAR},
182
+      verify_status = #{verifyStatus,jdbcType=VARCHAR},
183
+      openid = #{openid,jdbcType=VARCHAR},
184
+      nickname = #{nickname,jdbcType=VARCHAR},
185
+      create_date = #{createDate,jdbcType=TIMESTAMP}
186
+    where id = #{id,jdbcType=INTEGER}
187
+  </update>
188
+  <select id="selectByUserId" resultMap="BaseResultMap" parameterType="integer">
189
+    select
190
+    <include refid="Base_Column_List"/>
191
+    from ta_user_verify
192
+    where user_id = #{userId,jdbcType=INTEGER}
193
+  </select>
194
+</mapper>

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

@@ -0,0 +1,128 @@
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.TpBuildingMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TpBuilding" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="phase" property="phase" jdbcType="VARCHAR" />
8
+    <result column="building" property="building" jdbcType="VARCHAR" />
9
+    <result column="unit" property="unit" jdbcType="VARCHAR" />
10
+    <result column="level" property="level" jdbcType="VARCHAR" />
11
+    <result column="room_no" property="roomNo" jdbcType="VARCHAR" />
12
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
13
+  </resultMap>
14
+  <sql id="Base_Column_List" >
15
+    id, community_id, phase, building, unit, level, room_no, create_date
16
+  </sql>
17
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
18
+    select 
19
+    <include refid="Base_Column_List" />
20
+    from tp_building
21
+    where id = #{id,jdbcType=INTEGER}
22
+  </select>
23
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
24
+    delete from tp_building
25
+    where id = #{id,jdbcType=INTEGER}
26
+  </delete>
27
+  <insert id="insert" parameterType="com.community.huiju.model.TpBuilding" >
28
+    insert into tp_building (id, community_id, phase, 
29
+      building, unit, level, 
30
+      room_no, create_date)
31
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{phase,jdbcType=VARCHAR}, 
32
+      #{building,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, #{level,jdbcType=VARCHAR}, 
33
+      #{roomNo,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP})
34
+  </insert>
35
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TpBuilding" >
36
+    insert into tp_building
37
+    <trim prefix="(" suffix=")" suffixOverrides="," >
38
+      <if test="id != null" >
39
+        id,
40
+      </if>
41
+      <if test="communityId != null" >
42
+        community_id,
43
+      </if>
44
+      <if test="phase != null" >
45
+        phase,
46
+      </if>
47
+      <if test="building != null" >
48
+        building,
49
+      </if>
50
+      <if test="unit != null" >
51
+        unit,
52
+      </if>
53
+      <if test="level != null" >
54
+        level,
55
+      </if>
56
+      <if test="roomNo != null" >
57
+        room_no,
58
+      </if>
59
+      <if test="createDate != null" >
60
+        create_date,
61
+      </if>
62
+    </trim>
63
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
64
+      <if test="id != null" >
65
+        #{id,jdbcType=INTEGER},
66
+      </if>
67
+      <if test="communityId != null" >
68
+        #{communityId,jdbcType=INTEGER},
69
+      </if>
70
+      <if test="phase != null" >
71
+        #{phase,jdbcType=VARCHAR},
72
+      </if>
73
+      <if test="building != null" >
74
+        #{building,jdbcType=VARCHAR},
75
+      </if>
76
+      <if test="unit != null" >
77
+        #{unit,jdbcType=VARCHAR},
78
+      </if>
79
+      <if test="level != null" >
80
+        #{level,jdbcType=VARCHAR},
81
+      </if>
82
+      <if test="roomNo != null" >
83
+        #{roomNo,jdbcType=VARCHAR},
84
+      </if>
85
+      <if test="createDate != null" >
86
+        #{createDate,jdbcType=TIMESTAMP},
87
+      </if>
88
+    </trim>
89
+  </insert>
90
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpBuilding" >
91
+    update tp_building
92
+    <set >
93
+      <if test="communityId != null" >
94
+        community_id = #{communityId,jdbcType=INTEGER},
95
+      </if>
96
+      <if test="phase != null" >
97
+        phase = #{phase,jdbcType=VARCHAR},
98
+      </if>
99
+      <if test="building != null" >
100
+        building = #{building,jdbcType=VARCHAR},
101
+      </if>
102
+      <if test="unit != null" >
103
+        unit = #{unit,jdbcType=VARCHAR},
104
+      </if>
105
+      <if test="level != null" >
106
+        level = #{level,jdbcType=VARCHAR},
107
+      </if>
108
+      <if test="roomNo != null" >
109
+        room_no = #{roomNo,jdbcType=VARCHAR},
110
+      </if>
111
+      <if test="createDate != null" >
112
+        create_date = #{createDate,jdbcType=TIMESTAMP},
113
+      </if>
114
+    </set>
115
+    where id = #{id,jdbcType=INTEGER}
116
+  </update>
117
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpBuilding" >
118
+    update tp_building
119
+    set community_id = #{communityId,jdbcType=INTEGER},
120
+      phase = #{phase,jdbcType=VARCHAR},
121
+      building = #{building,jdbcType=VARCHAR},
122
+      unit = #{unit,jdbcType=VARCHAR},
123
+      level = #{level,jdbcType=VARCHAR},
124
+      room_no = #{roomNo,jdbcType=VARCHAR},
125
+      create_date = #{createDate,jdbcType=TIMESTAMP}
126
+    where id = #{id,jdbcType=INTEGER}
127
+  </update>
128
+</mapper>

+ 6
- 0
CODE/smart-community/community-common/src/main/java/com/community/commom/mode/ResponseBean.java Datei anzeigen

@@ -41,6 +41,12 @@ public class ResponseBean<T> implements Serializable {
41 41
         this.message = message;
42 42
     }
43 43
 
44
+    public void addSuccess(String code, T data) {
45
+        this.code = code;
46
+        this.message = "成功";
47
+        this.data = data;
48
+    }
49
+
44 50
     public void addSuccess(T data) {
45 51
         this.code = "0";
46 52
         this.message = "成功";