liusuyi
2026-05-14 9958bc1501d0daee954d9bba383475e55e24ebab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
package com.ard.qs.mapper;
 
import com.ard.qs.api.domain.QsDevice;
import com.ard.qs.api.domain.QsGroup;
import com.ard.qs.api.domain.QsRegion;
import com.ard.qs.domain.*;
import org.apache.ibatis.annotations.Param;
 
import java.util.List;
import java.util.Set;
 
/**
 * 视频监控设备Mapper接口
 *
 * @author fengcheng
 * @date 2026-03-27
 */
public interface QsDeviceMapper {
    /**
     * 查询视频监控设备
     *
     * @param id 视频监控设备主键
     * @return 视频监控设备
     */
    public QsDevice selectQsDeviceById(Long id);
 
    /**
     * 查询视频监控设备列表
     *
     * @param qsDevice 视频监控设备
     * @return 视频监控设备集合
     */
    public List<QsDevice> selectQsDeviceList(QsDevice qsDevice);
 
    /**
     * 新增视频监控设备
     *
     * @param qsDevice 视频监控设备
     * @return 结果
     */
    public int insertQsDevice(QsDevice qsDevice);
 
    /**
     * 修改视频监控设备
     *
     * @param qsDevice 视频监控设备
     * @return 结果
     */
    public int updateQsDevice(QsDevice qsDevice);
 
    /**
     * 删除视频监控设备
     *
     * @param id 视频监控设备主键
     * @return 结果
     */
    public int deleteQsDeviceById(Long id);
 
    /**
     * 批量删除视频监控设备
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteQsDeviceByIds(Long[] ids);
 
    /**
     * 状态修改
     *
     * @param id     视频监控设备主键
     * @param status 状态
     * @return
     */
    int updateQsDeviceStatus(@Param("id") Long id, @Param("status") String status);
 
    /**
     * 更新设备在线状态
     *
     * @param onlineDeviceSet 在线设备集合
     * @param deviceStatus    设备状态
     * @return
     */
    Boolean updateQsDeviceStatusList(@Param("list") Set<Long> onlineDeviceSet, @Param("deviceStatus") String deviceStatus);
 
    /**
     * 更具流id获取视频监控设备
     *
     * @param stream 流id
     * @return
     */
    QsDevice getQsDeviceStream(String stream);
 
    /**
     * 修改所有设备播状态离线和设备状态离线
     */
    void updateAllQsDevicesToOffline();
 
    /**
     * 获取所有视频监控设备流地址
     *
     * @return
     */
    List<QsDevice> fetchAllQsDeviceStreamUrls();
 
    /**
     * 更新所有视频监控设备流地址
     *
     * @param newQsDeviceList
     */
    void updateAllQsDeviceStreamUrls(List<QsDevice> newQsDeviceList);
 
    /**
     * 获取计划记录对应的视频监控设备
     *
     * @param qsDevice 视频监控设备
     * @return
     */
    List<QsDevice> listPlanRecordQsDevice(QsDevice qsDevice);
 
    /**
     * 录制计划关联所有设备
     *
     * @param planId
     */
    void linkAll(Long planId);
 
    /**
     * 录制计划取消关联所有设备
     *
     * @param planId
     */
    void cleanAll(Long planId);
 
    /**
     * 设备关联录制计划
     *
     * @param deviceIds
     * @param planId
     */
    void link(@Param("deviceIds") List<Long> deviceIds, @Param("planId") Long planId);
 
    /**
     * 清理设备计划id
     *
     * @param planId 设备id
     */
    void cleanRecordPlanId(Long planId);
 
    /**
     * 根据设备id集合查询设备信息
     *
     * @param startDeviceIdList 设备id集合
     * @return
     */
    List<QsDevice> queryByIds(@Param("startDeviceIdList") List<Long> startDeviceIdList);
 
    /**
     * 根据计划id查询设备数量
     *
     * @param planId 设备id
     * @return
     */
    Integer countRecordPlanDevice(Long planId);
 
    /**
     * 根据行政区划查询设备信息
     *
     * @param civilCode 行政区划
     * @return
     */
    List<QsDevice> queryByCivilCode(@Param("civilCode") String civilCode);
 
    /**
     * 根据行政区划更新设备信息
     *
     * @param civilCode  行政区划
     * @param deviceList 设备信息
     * @return
     */
    int updateCivilCodeByDeviceList(@Param("civilCode") String civilCode, @Param("deviceList") List<QsDevice> deviceList);
 
    /**
     * 根据行政区划编码删除设备
     *
     * @param allChildren 所有子节点
     */
    void removeCivilCode(@Param("allChildren") List<QsRegion> allChildren);
 
    /**
     * 根据设备id查询设备关联的行政区划树
     *
     * @param deviceId 区域国标编号
     * @return
     */
    List<QsRegionTree> queryForRegionTreeByCivilCode(String deviceId);
 
    /**
     * 根据设备id集合查询设备关联的行政区划树
     *
     * @param businessGroup
     * @param deviceList
     * @return
     */
    int updateBusinessGroupBydeviceList(@Param("businessGroup") String businessGroup, @Param("deviceList") List<QsDevice> deviceList);
 
    /**
     * 根据业务分组查询设备信息
     *
     * @param businessGroup
     * @return
     */
    List<QsDevice> queryByBusinessGroup(@Param("businessGroup") String businessGroup);
 
    /**
     * 根据父节点查询设备信息
     *
     * @param parentId
     * @return
     */
    List<QsDevice> queryByParentId(@Param("parentId") String parentId);
 
    /**
     * 根据父节点更新设备信息
     *
     * @param parentId
     * @param deviceList
     * @return
     */
    int updateParentIdByDeviceList(@Param("parentId") String parentId, @Param("deviceList") List<QsDevice> deviceList);
 
    /**
     * 根据通道id集合更新设备信息
     *
     * @param deviceList
     * @return
     */
    int removeParentIdByDevices(@Param("deviceList") List<QsDevice> deviceList);
 
    /**
     * 根据分组查询设备信息
     *
     * @param groupList
     * @return
     */
    List<QsDevice> queryByGroupList(List<QsGroup> groupList);
 
    /**
     * 根据业务分组查询设备关联的业务分组树
     *
     * @param query
     * @param parent
     * @return
     */
    List<QsGroupTree> queryForGroupTreeByParentId(@Param("query") String query, @Param("parent") String parent);
 
    /**
     * 根据行政区域获取视频监控设备列表
     *
     * @param qsDevice
     * @return
     */
    List<QsDevice> queryListByCivilCode(QsDevice qsDevice);
 
    /**
     * 根据行政区划编码添加设备
     *
     * @param civilCode
     * @param deviceList
     */
    int updateRegion(@Param("civilCode") String civilCode, @Param("deviceList") List<QsDevice> deviceList);
 
    /**
     * 根据行政区划编码删除设备
     *
     * @param deviceList
     * @return
     */
    int removeCivilCodeByDeletes(@Param("deviceList") List<QsDevice> deviceList);
 
    /**
     * 存在行政区划但无法挂载的通道列表
     *
     * @param qsDevice
     * @return
     */
    List<QsDevice> queryListByCivilCodeForUnusual(QsDevice qsDevice);
 
    /**
     * 获取所有异常的行政区划编码
     *
     * @return
     */
    List<Long> queryAllForUnusualCivilCode();
 
    /**
     * 根据设备id集合更新行政区划
     *
     * @param deviceList
     */
    void removeCivilCodeByDeviceIds(@Param("deviceList") List<Long> deviceList);
 
    /**
     * 获取关联业务分组通道列表
     *
     * @param qsDevice
     * @return
     */
    List<QsDevice> queryListByParentId(QsDevice qsDevice);
 
    /**
     * 设备设置业务分组
     *
     * @param parentId
     * @param businessGroup
     * @param deviceList
     * @return
     */
    int updateGroup(@Param("parentId") String parentId, @Param("businessGroup") String businessGroup, @Param("deviceList") List<QsDevice> deviceList);
 
    /**
     * 存在父节点编号但无法挂载的设备列表
     *
     * @param qsDevice
     * @return
     */
    List<QsDevice> queryListByParentForUnusual(QsDevice qsDevice);
 
    /**
     * 获取所有异常的父节点编号
     *
     * @return
     */
    List<Long> queryAllForUnusualParent();
 
    /**
     * 根据设备id集合更新父节点
     *
     * @param deviceIdsForClear
     */
    void removeParentIdByDeviceIds(@Param("deviceIdsForClear") List<Long> deviceIdsForClear);
 
    /**
     * 获取设备统计信息
     *
     * @return
     */
    DeviceStats getDeviceStatistics();
}