瀏覽代碼

完成 监控,单元门,远程开门 查看次数

魏熙美 6 年之前
父節點
當前提交
db4a042713

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/HkController.java 查看文件

@@ -61,7 +61,7 @@ public class HkController extends BaseController {
61 61
 
62 62
 	@ApiOperation(value = "门口机开门", notes = "门口机开门")
63 63
 	@ApiImplicitParams({
64
-			@ApiImplicitParam(dataTypeClass = Integer.class, paramType = "header", name = "X-Auth-Token", value = "用户审核房产id")
64
+			@ApiImplicitParam(dataTypeClass = Integer.class, paramType = "header", name = "X-Auth-Token", value = "Token")
65 65
 	})
66 66
 	@RequestMapping(value = "/visual/syncControl", method = RequestMethod.POST)
67 67
 	public ResponseBean syncControl( HttpServletRequest request, HttpSession session){

+ 12
- 6
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/MonitoringController.java 查看文件

@@ -30,19 +30,22 @@ public class MonitoringController extends BaseController {
30 30
     @ApiImplicitParams({
31 31
             @ApiImplicitParam(paramType = "path",dataType = "Integer",name = "communityId",value = "小区ID"),
32 32
             @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "pageNo",value = "第几页"),
33
-            @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "pageSize",value = "一页多少行")
33
+            @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "pageSize",value = "一页多少行"),
34
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
34 35
     })
35 36
     @RequestMapping(value = "/monitoring/{communityId}",method = RequestMethod.GET)
36 37
     public ResponseBean getList(@PathVariable("communityId") Integer communityId,
37 38
                                 @RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
38
-                                @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
39
+                                @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
40
+                                HttpSession session){
39 41
         ResponseBean response = new ResponseBean();
40 42
         if (!check(communityId)) {
41 43
             response.addError("小区不存在");
42 44
             return response;
43 45
         }
44 46
 
45
-        response = iMonitoringService.getByCommunityId(communityId,pageNo,pageSize);
47
+        UserElement userElement = getUserElement(session);
48
+        response = iMonitoringService.getByCommunityId(userElement,communityId,pageNo,pageSize);
46 49
         return response;
47 50
     }
48 51
 
@@ -71,15 +74,18 @@ public class MonitoringController extends BaseController {
71 74
     @ApiImplicitParams({
72 75
             @ApiImplicitParam(paramType = "path",dataType = "Integer",name = "communityId",value = "小区ID"),
73 76
             @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "pageNo",value = "第几页"),
74
-            @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "pageSize",value = "一页多少行")
77
+            @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "pageSize",value = "一页多少行"),
78
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
75 79
     })
76 80
     @RequestMapping(value = "/monitoring/hls/{communityId}",method = RequestMethod.GET)
77 81
     public ResponseBean getListHLS(@PathVariable("communityId") Integer communityId,
78 82
                                    @RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
79
-                                   @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize) {
83
+                                   @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
84
+                                   HttpSession session) {
80 85
 
81 86
         ResponseBean responseBean = new ResponseBean();
82
-        responseBean = iMonitoringService.getHlsByCommunityId(communityId, pageNo, pageSize);
87
+        UserElement userElement = getUserElement(session);
88
+        responseBean = iMonitoringService.getHlsByCommunityId(userElement,communityId, pageNo, pageSize);
83 89
         return responseBean;
84 90
     }
85 91
 

+ 19
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaPublicMonitorMapper.java 查看文件

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

+ 19
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaRemotelyDoorMapper.java 查看文件

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

+ 19
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaRemotelyMonitorMapper.java 查看文件

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

+ 45
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaPublicMonitor.java 查看文件

@@ -0,0 +1,45 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class TaPublicMonitor {
6
+    private Integer id;
7
+
8
+    private Integer communityId;
9
+
10
+    private Integer taUserVerifyId;
11
+
12
+    private Date createDate;
13
+
14
+    public Integer getId() {
15
+        return id;
16
+    }
17
+
18
+    public void setId(Integer id) {
19
+        this.id = id;
20
+    }
21
+
22
+    public Integer getCommunityId() {
23
+        return communityId;
24
+    }
25
+
26
+    public void setCommunityId(Integer communityId) {
27
+        this.communityId = communityId;
28
+    }
29
+
30
+    public Integer getTaUserVerifyId() {
31
+        return taUserVerifyId;
32
+    }
33
+
34
+    public void setTaUserVerifyId(Integer taUserVerifyId) {
35
+        this.taUserVerifyId = taUserVerifyId;
36
+    }
37
+
38
+    public Date getCreateDate() {
39
+        return createDate;
40
+    }
41
+
42
+    public void setCreateDate(Date createDate) {
43
+        this.createDate = createDate;
44
+    }
45
+}

+ 55
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaRemotelyDoor.java 查看文件

@@ -0,0 +1,55 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class TaRemotelyDoor {
6
+    private Integer id;
7
+
8
+    private Integer communityId;
9
+
10
+    private Integer taUserVerifyId;
11
+
12
+    private Integer unitId;
13
+
14
+    private Date createDate;
15
+
16
+    public Integer getId() {
17
+        return id;
18
+    }
19
+
20
+    public void setId(Integer id) {
21
+        this.id = id;
22
+    }
23
+
24
+    public Integer getCommunityId() {
25
+        return communityId;
26
+    }
27
+
28
+    public void setCommunityId(Integer communityId) {
29
+        this.communityId = communityId;
30
+    }
31
+
32
+    public Integer getTaUserVerifyId() {
33
+        return taUserVerifyId;
34
+    }
35
+
36
+    public void setTaUserVerifyId(Integer taUserVerifyId) {
37
+        this.taUserVerifyId = taUserVerifyId;
38
+    }
39
+
40
+    public Integer getUnitId() {
41
+        return unitId;
42
+    }
43
+
44
+    public void setUnitId(Integer unitId) {
45
+        this.unitId = unitId;
46
+    }
47
+
48
+    public Date getCreateDate() {
49
+        return createDate;
50
+    }
51
+
52
+    public void setCreateDate(Date createDate) {
53
+        this.createDate = createDate;
54
+    }
55
+}

+ 55
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaRemotelyMonitor.java 查看文件

@@ -0,0 +1,55 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class TaRemotelyMonitor {
6
+    private Integer id;
7
+
8
+    private Integer communityId;
9
+
10
+    private Integer taUserVerifyId;
11
+
12
+    private Integer unitId;
13
+
14
+    private Date createDate;
15
+
16
+    public Integer getId() {
17
+        return id;
18
+    }
19
+
20
+    public void setId(Integer id) {
21
+        this.id = id;
22
+    }
23
+
24
+    public Integer getCommunityId() {
25
+        return communityId;
26
+    }
27
+
28
+    public void setCommunityId(Integer communityId) {
29
+        this.communityId = communityId;
30
+    }
31
+
32
+    public Integer getTaUserVerifyId() {
33
+        return taUserVerifyId;
34
+    }
35
+
36
+    public void setTaUserVerifyId(Integer taUserVerifyId) {
37
+        this.taUserVerifyId = taUserVerifyId;
38
+    }
39
+
40
+    public Integer getUnitId() {
41
+        return unitId;
42
+    }
43
+
44
+    public void setUnitId(Integer unitId) {
45
+        this.unitId = unitId;
46
+    }
47
+
48
+    public Date getCreateDate() {
49
+        return createDate;
50
+    }
51
+
52
+    public void setCreateDate(Date createDate) {
53
+        this.createDate = createDate;
54
+    }
55
+}

+ 2
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/IMonitoringService.java 查看文件

@@ -16,7 +16,7 @@ public interface IMonitoringService {
16 16
      * @param pageSize
17 17
      * @return
18 18
      */
19
-    ResponseBean getByCommunityId(Integer communityId,Integer pageNo, Integer pageSize);
19
+    ResponseBean getByCommunityId(UserElement userElement, Integer communityId,Integer pageNo, Integer pageSize);
20 20
 
21 21
     /**
22 22
      * 生成 Token
@@ -32,7 +32,7 @@ public interface IMonitoringService {
32 32
      * @param communityId
33 33
      * @return
34 34
      */
35
-    ResponseBean getHlsByCommunityId(Integer communityId, Integer pageNo, Integer pageSize);
35
+    ResponseBean getHlsByCommunityId(UserElement userElement, Integer communityId, Integer pageNo, Integer pageSize);
36 36
 
37 37
     /**
38 38
      * 可是对讲 视频流

+ 12
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/HKServiceImpl.java 查看文件

@@ -50,6 +50,9 @@ public class HKServiceImpl implements IHKService {
50 50
     @Autowired
51 51
     private TaUserVerifyMapper taUserVerifyMapper;
52 52
 
53
+    @Autowired
54
+    private TaRemotelyDoorMapper taRemotelyDoorMapper;
55
+
53 56
     /**
54 57
      * 获取设备UUID
55 58
      * @param equipmentList
@@ -354,6 +357,15 @@ public class HKServiceImpl implements IHKService {
354 357
         JSONObject jsonObject = JSONObject.parseObject(data);
355 358
         int errorCode = jsonObject.getInteger("errorCode");
356 359
         if (errorCode == 0) {
360
+
361
+            // 记录 远程开门次数
362
+            TaRemotelyDoor taRemotelyDoor = new TaRemotelyDoor();
363
+            taRemotelyDoor.setCommunityId(userVerify.getCommunityId());
364
+            taRemotelyDoor.setTaUserVerifyId(userVerify.getUserId());
365
+            taRemotelyDoor.setUnitId(userVerify.getUnitId());
366
+            taRemotelyDoor.setCreateDate(new Date());
367
+            taRemotelyDoorMapper.insertSelective(taRemotelyDoor);
368
+
357 369
             responseBean.addSuccess("操作成功!");
358 370
             return responseBean;
359 371
         }

+ 52
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/MonitoringServiceImpl.java 查看文件

@@ -25,6 +25,7 @@ import org.springframework.stereotype.Service;
25 25
 import java.time.Instant;
26 26
 import java.time.LocalDateTime;
27 27
 import java.time.ZoneId;
28
+import java.util.Date;
28 29
 import java.util.HashMap;
29 30
 import java.util.List;
30 31
 import java.util.Map;
@@ -67,8 +68,14 @@ public class MonitoringServiceImpl implements IMonitoringService {
67 68
     @Autowired
68 69
     private ToCommunitiesMapper toCommunitiesMapper;
69 70
 
71
+    @Autowired
72
+    private TaPublicMonitorMapper taPublicMonitorMapper;
73
+
74
+    @Autowired
75
+    private TaRemotelyMonitorMapper taRemotelyMonitorMapper;
76
+
70 77
     @Override
71
-    public ResponseBean getByCommunityId(Integer communityId,Integer pageNo, Integer pageSize) {
78
+    public ResponseBean getByCommunityId(UserElement userElement, Integer communityId,Integer pageNo, Integer pageSize) {
72 79
 
73 80
         // TODO 数据是假数据, 后期在更改. 需要根据小区查询 组织中心编号
74 81
 
@@ -95,6 +102,11 @@ public class MonitoringServiceImpl implements IMonitoringService {
95 102
         Page<TpEquipment> page = PageHelper.startPage(pageNo, pageSize);
96 103
         List<TpEquipment> tpEquipments = tpEquipmentMapper.selectByCommunityId(communityId);
97 104
 
105
+        if (CollectionUtils.isEmpty(tpEquipments)) {
106
+            response.addError("系统未配置监控设备!");
107
+            return response;
108
+        }
109
+
98 110
         Map<String, Object> map = Maps.newHashMap();
99 111
         map.put("pageNo", page.getPageNum());
100 112
         map.put("pageSize", page.getPageSize());
@@ -102,9 +114,29 @@ public class MonitoringServiceImpl implements IMonitoringService {
102 114
         map.put("list", tpEquipments);
103 115
         response.addSuccess(map);
104 116
 
117
+        // 记录 查看监控
118
+        insertPublicMonitor(communityId, userElement.getId());
119
+
105 120
         return response;
106 121
     }
107 122
 
123
+    /**
124
+     * 记录 查看监控
125
+     * @param communityId
126
+     * @param userId
127
+     * @return
128
+     */
129
+    private TaPublicMonitor insertPublicMonitor(Integer communityId, Integer userId) {
130
+        // 记录查看监控设备
131
+        TaPublicMonitor taPublicMonitor = new TaPublicMonitor();
132
+        taPublicMonitor.setCommunityId(communityId);
133
+        taPublicMonitor.setTaUserVerifyId(userId);
134
+        taPublicMonitor.setCreateDate(new Date());
135
+        taPublicMonitorMapper.insertSelective(taPublicMonitor);
136
+
137
+        return taPublicMonitor;
138
+    }
139
+
108 140
     @Override
109 141
     public ResponseBean getMonitoringToken(Integer communityId, Integer pageNo, Integer pageSize) {
110 142
 
@@ -168,17 +200,26 @@ public class MonitoringServiceImpl implements IMonitoringService {
168 200
     }
169 201
 
170 202
     @Override
171
-    public ResponseBean getHlsByCommunityId(Integer communityId, Integer pageNo, Integer pageSize) {
203
+    public ResponseBean getHlsByCommunityId(UserElement userElement, Integer communityId, Integer pageNo, Integer pageSize) {
172 204
         ResponseBean response = new ResponseBean();
173 205
         Page<TpEquipment> page = PageHelper.startPage(pageNo, pageSize);
174 206
         List<TpEquipment> tpEquipments = tpEquipmentMapper.selectHlsByCommunityId(communityId);
175 207
 
208
+        if (CollectionUtils.isEmpty(tpEquipments)) {
209
+            response.addError("系统未配置监控设备!");
210
+            return response;
211
+        }
212
+
176 213
         Map<String, Object> map = Maps.newHashMap();
177 214
         map.put("pageNo", page.getPageNum());
178 215
         map.put("pageSize", page.getPageSize());
179 216
         map.put("total", page.getTotal());
180 217
         map.put("list", tpEquipments);
181 218
         response.addSuccess(map);
219
+
220
+        // 记录 查看监控
221
+        insertPublicMonitor(communityId, userElement.getId());
222
+
182 223
         return response;
183 224
     }
184 225
 
@@ -238,6 +279,15 @@ public class MonitoringServiceImpl implements IMonitoringService {
238 279
         map.put("address", toCommunities.getCommunityName() + tpUnit.getPhaseName() + tpUnit.getBuildingName() + tpUnit.getName());
239 280
         map.put("token", tpEquipment.getOpUserUuid());
240 281
         responseBean.addSuccess(map);
282
+
283
+        // 记录 单元门监控查看
284
+        TaRemotelyMonitor taRemotelyMonitor = new TaRemotelyMonitor();
285
+        taRemotelyMonitor.setCommunityId(userElement.getCommunityId());
286
+        taRemotelyMonitor.setTaUserVerifyId(userElement.getId());
287
+        taRemotelyMonitor.setUnitId(userElement.getUnitId());
288
+        taRemotelyMonitor.setCreateDate(new Date());
289
+        taRemotelyMonitorMapper.insertSelective(taRemotelyMonitor);
290
+
241 291
         return responseBean;
242 292
     }
243 293
 }

+ 82
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TaPublicMonitorMapper.xml 查看文件

@@ -0,0 +1,82 @@
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.TaPublicMonitorMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TaPublicMonitor" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="ta_user_verify_id" property="taUserVerifyId" jdbcType="INTEGER" />
8
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
9
+  </resultMap>
10
+  <sql id="Base_Column_List" >
11
+    id, community_id, ta_user_verify_id, create_date
12
+  </sql>
13
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
14
+    select 
15
+    <include refid="Base_Column_List" />
16
+    from ta_public_monitor
17
+    where id = #{id,jdbcType=INTEGER}
18
+  </select>
19
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
20
+    delete from ta_public_monitor
21
+    where id = #{id,jdbcType=INTEGER}
22
+  </delete>
23
+  <insert id="insert" parameterType="com.community.huiju.model.TaPublicMonitor" useGeneratedKeys="true" keyProperty="id" keyColumn="id" >
24
+    insert into ta_public_monitor (id, community_id, ta_user_verify_id, 
25
+      create_date)
26
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{taUserVerifyId,jdbcType=INTEGER}, 
27
+      #{createDate,jdbcType=TIMESTAMP})
28
+  </insert>
29
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TaPublicMonitor" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
30
+    insert into ta_public_monitor
31
+    <trim prefix="(" suffix=")" suffixOverrides="," >
32
+      <if test="id != null" >
33
+        id,
34
+      </if>
35
+      <if test="communityId != null" >
36
+        community_id,
37
+      </if>
38
+      <if test="taUserVerifyId != null" >
39
+        ta_user_verify_id,
40
+      </if>
41
+      <if test="createDate != null" >
42
+        create_date,
43
+      </if>
44
+    </trim>
45
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
46
+      <if test="id != null" >
47
+        #{id,jdbcType=INTEGER},
48
+      </if>
49
+      <if test="communityId != null" >
50
+        #{communityId,jdbcType=INTEGER},
51
+      </if>
52
+      <if test="taUserVerifyId != null" >
53
+        #{taUserVerifyId,jdbcType=INTEGER},
54
+      </if>
55
+      <if test="createDate != null" >
56
+        #{createDate,jdbcType=TIMESTAMP},
57
+      </if>
58
+    </trim>
59
+  </insert>
60
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TaPublicMonitor" >
61
+    update ta_public_monitor
62
+    <set >
63
+      <if test="communityId != null" >
64
+        community_id = #{communityId,jdbcType=INTEGER},
65
+      </if>
66
+      <if test="taUserVerifyId != null" >
67
+        ta_user_verify_id = #{taUserVerifyId,jdbcType=INTEGER},
68
+      </if>
69
+      <if test="createDate != null" >
70
+        create_date = #{createDate,jdbcType=TIMESTAMP},
71
+      </if>
72
+    </set>
73
+    where id = #{id,jdbcType=INTEGER}
74
+  </update>
75
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TaPublicMonitor" >
76
+    update ta_public_monitor
77
+    set community_id = #{communityId,jdbcType=INTEGER},
78
+      ta_user_verify_id = #{taUserVerifyId,jdbcType=INTEGER},
79
+      create_date = #{createDate,jdbcType=TIMESTAMP}
80
+    where id = #{id,jdbcType=INTEGER}
81
+  </update>
82
+</mapper>

+ 93
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TaRemotelyDoorMapper.xml 查看文件

@@ -0,0 +1,93 @@
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.TaRemotelyDoorMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TaRemotelyDoor" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="ta_user_verify_id" property="taUserVerifyId" jdbcType="INTEGER" />
8
+    <result column="unit_id" property="unitId" jdbcType="INTEGER" />
9
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
10
+  </resultMap>
11
+  <sql id="Base_Column_List" >
12
+    id, community_id, ta_user_verify_id, unit_id, create_date
13
+  </sql>
14
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
15
+    select 
16
+    <include refid="Base_Column_List" />
17
+    from ta_remotely_door
18
+    where id = #{id,jdbcType=INTEGER}
19
+  </select>
20
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
21
+    delete from ta_remotely_door
22
+    where id = #{id,jdbcType=INTEGER}
23
+  </delete>
24
+  <insert id="insert" parameterType="com.community.huiju.model.TaRemotelyDoor" useGeneratedKeys="true" keyProperty="id" keyColumn="id" >
25
+    insert into ta_remotely_door (id, community_id, ta_user_verify_id, 
26
+      unit_id, create_date)
27
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{taUserVerifyId,jdbcType=INTEGER}, 
28
+      #{unitId,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP})
29
+  </insert>
30
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TaRemotelyDoor" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
31
+    insert into ta_remotely_door
32
+    <trim prefix="(" suffix=")" suffixOverrides="," >
33
+      <if test="id != null" >
34
+        id,
35
+      </if>
36
+      <if test="communityId != null" >
37
+        community_id,
38
+      </if>
39
+      <if test="taUserVerifyId != null" >
40
+        ta_user_verify_id,
41
+      </if>
42
+      <if test="unitId != null" >
43
+        unit_id,
44
+      </if>
45
+      <if test="createDate != null" >
46
+        create_date,
47
+      </if>
48
+    </trim>
49
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
50
+      <if test="id != null" >
51
+        #{id,jdbcType=INTEGER},
52
+      </if>
53
+      <if test="communityId != null" >
54
+        #{communityId,jdbcType=INTEGER},
55
+      </if>
56
+      <if test="taUserVerifyId != null" >
57
+        #{taUserVerifyId,jdbcType=INTEGER},
58
+      </if>
59
+      <if test="unitId != null" >
60
+        #{unitId,jdbcType=INTEGER},
61
+      </if>
62
+      <if test="createDate != null" >
63
+        #{createDate,jdbcType=TIMESTAMP},
64
+      </if>
65
+    </trim>
66
+  </insert>
67
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TaRemotelyDoor" >
68
+    update ta_remotely_door
69
+    <set >
70
+      <if test="communityId != null" >
71
+        community_id = #{communityId,jdbcType=INTEGER},
72
+      </if>
73
+      <if test="taUserVerifyId != null" >
74
+        ta_user_verify_id = #{taUserVerifyId,jdbcType=INTEGER},
75
+      </if>
76
+      <if test="unitId != null" >
77
+        unit_id = #{unitId,jdbcType=INTEGER},
78
+      </if>
79
+      <if test="createDate != null" >
80
+        create_date = #{createDate,jdbcType=TIMESTAMP},
81
+      </if>
82
+    </set>
83
+    where id = #{id,jdbcType=INTEGER}
84
+  </update>
85
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TaRemotelyDoor" >
86
+    update ta_remotely_door
87
+    set community_id = #{communityId,jdbcType=INTEGER},
88
+      ta_user_verify_id = #{taUserVerifyId,jdbcType=INTEGER},
89
+      unit_id = #{unitId,jdbcType=INTEGER},
90
+      create_date = #{createDate,jdbcType=TIMESTAMP}
91
+    where id = #{id,jdbcType=INTEGER}
92
+  </update>
93
+</mapper>

+ 93
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TaRemotelyMonitorMapper.xml 查看文件

@@ -0,0 +1,93 @@
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.TaRemotelyMonitorMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TaRemotelyMonitor" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="ta_user_verify_id" property="taUserVerifyId" jdbcType="INTEGER" />
8
+    <result column="unit_id" property="unitId" jdbcType="INTEGER" />
9
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
10
+  </resultMap>
11
+  <sql id="Base_Column_List" >
12
+    id, community_id, ta_user_verify_id, unit_id, create_date
13
+  </sql>
14
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
15
+    select 
16
+    <include refid="Base_Column_List" />
17
+    from ta_remotely_monitor
18
+    where id = #{id,jdbcType=INTEGER}
19
+  </select>
20
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
21
+    delete from ta_remotely_monitor
22
+    where id = #{id,jdbcType=INTEGER}
23
+  </delete>
24
+  <insert id="insert" parameterType="com.community.huiju.model.TaRemotelyMonitor" useGeneratedKeys="true" keyProperty="id" keyColumn="id" >
25
+    insert into ta_remotely_monitor (id, community_id, ta_user_verify_id, 
26
+      unit_id, create_date)
27
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{taUserVerifyId,jdbcType=INTEGER}, 
28
+      #{unitId,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP})
29
+  </insert>
30
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TaRemotelyMonitor" useGeneratedKeys="true" keyProperty="id" keyColumn="id" >
31
+    insert into ta_remotely_monitor
32
+    <trim prefix="(" suffix=")" suffixOverrides="," >
33
+      <if test="id != null" >
34
+        id,
35
+      </if>
36
+      <if test="communityId != null" >
37
+        community_id,
38
+      </if>
39
+      <if test="taUserVerifyId != null" >
40
+        ta_user_verify_id,
41
+      </if>
42
+      <if test="unitId != null" >
43
+        unit_id,
44
+      </if>
45
+      <if test="createDate != null" >
46
+        create_date,
47
+      </if>
48
+    </trim>
49
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
50
+      <if test="id != null" >
51
+        #{id,jdbcType=INTEGER},
52
+      </if>
53
+      <if test="communityId != null" >
54
+        #{communityId,jdbcType=INTEGER},
55
+      </if>
56
+      <if test="taUserVerifyId != null" >
57
+        #{taUserVerifyId,jdbcType=INTEGER},
58
+      </if>
59
+      <if test="unitId != null" >
60
+        #{unitId,jdbcType=INTEGER},
61
+      </if>
62
+      <if test="createDate != null" >
63
+        #{createDate,jdbcType=TIMESTAMP},
64
+      </if>
65
+    </trim>
66
+  </insert>
67
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TaRemotelyMonitor" >
68
+    update ta_remotely_monitor
69
+    <set >
70
+      <if test="communityId != null" >
71
+        community_id = #{communityId,jdbcType=INTEGER},
72
+      </if>
73
+      <if test="taUserVerifyId != null" >
74
+        ta_user_verify_id = #{taUserVerifyId,jdbcType=INTEGER},
75
+      </if>
76
+      <if test="unitId != null" >
77
+        unit_id = #{unitId,jdbcType=INTEGER},
78
+      </if>
79
+      <if test="createDate != null" >
80
+        create_date = #{createDate,jdbcType=TIMESTAMP},
81
+      </if>
82
+    </set>
83
+    where id = #{id,jdbcType=INTEGER}
84
+  </update>
85
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TaRemotelyMonitor" >
86
+    update ta_remotely_monitor
87
+    set community_id = #{communityId,jdbcType=INTEGER},
88
+      ta_user_verify_id = #{taUserVerifyId,jdbcType=INTEGER},
89
+      unit_id = #{unitId,jdbcType=INTEGER},
90
+      create_date = #{createDate,jdbcType=TIMESTAMP}
91
+    where id = #{id,jdbcType=INTEGER}
92
+  </update>
93
+</mapper>