Commit e695220fe7c8b3b337ab9220d78b46679650e28a
Merge branch '2024-2-26' into 'master_dev'
fix:修改获取视频列表接口查询为sql查询获取params字段 See merge request yunteng/thingskit!346
Showing
3 changed files
with
31 additions
and
9 deletions
... | ... | @@ -189,14 +189,7 @@ public class TkVideoServiceImpl extends AbstractBaseService<TkVideoMapper, TkVid |
189 | 189 | organizationIds.add(organizationId); |
190 | 190 | } |
191 | 191 | } |
192 | - List<TkVideoEntity> list = baseMapper.selectList(new LambdaQueryWrapper<TkVideoEntity>() | |
193 | - .eq(TkVideoEntity::getTenantId, tenantId) | |
194 | - .in(!organizationIds.isEmpty(), | |
195 | - TkVideoEntity::getOrganizationId,organizationIds)); | |
196 | - if(!list.isEmpty()){ | |
197 | - return list.stream().map(entity->entity.getDTO(TkVideoDTO.class)).collect(Collectors.toList()); | |
198 | - } | |
199 | - return null; | |
192 | + return baseMapper.getVideoInfosByOrganizationIds(tenantId,organizationIds); | |
200 | 193 | } |
201 | 194 | private String HikVisionArtemis(TkVideoDTO videoDTO, ProtocolType protocolType){ |
202 | 195 | if(protocolType!=null && protocolType.equals(ProtocolType.HLS)){ | ... | ... |
... | ... | @@ -27,7 +27,7 @@ public interface TkVideoMapper extends BaseMapper<TkVideoEntity> { |
27 | 27 | @Param("status") Boolean status, @Param("organization") List<String> organizationId); |
28 | 28 | |
29 | 29 | /** |
30 | - * 根据租户ID、当前客户ID、视频ID、视频流获取方式,查询视频信息 | |
30 | + * 根据租户ID、当前客户ID、视频ID、视频流获取方式\,查询视频信息 | |
31 | 31 | * @param tenantId 租户ID |
32 | 32 | * @param id 视频ID |
33 | 33 | * @param accessMode 流获取方式 |
... | ... | @@ -35,4 +35,13 @@ public interface TkVideoMapper extends BaseMapper<TkVideoEntity> { |
35 | 35 | */ |
36 | 36 | List<TkVideoDTO> getVideoInfosByTenantIdOrAccessModeOrId(@Param("tenantId") String tenantId, @Param("id") String id, |
37 | 37 | @Param("accessMode") Integer accessMode); |
38 | + | |
39 | + | |
40 | + /** | |
41 | + * 根据租户ID、当前客户ID、视频ID、视频流获取方式\,查询视频信息 | |
42 | + * @param tenantId 租户ID | |
43 | + * @param organizationIds 组织id | |
44 | + * @return | |
45 | + */ | |
46 | + List<TkVideoDTO> getVideoInfosByOrganizationIds(@Param("tenantId") String tenantId, @Param("organizationIds") List<String> organizationIds); | |
38 | 47 | } | ... | ... |
... | ... | @@ -93,4 +93,24 @@ |
93 | 93 | </if> |
94 | 94 | </where> |
95 | 95 | </select> |
96 | + | |
97 | + <select id="getVideoInfosByOrganizationIds" resultMap="videoMap"> | |
98 | + SELECT | |
99 | + <include refid="detailColumns"/> | |
100 | + FROM tk_device_camera base | |
101 | + LEFT JOIN tk_organization org ON org.id = base.organization_id | |
102 | + LEFT JOIN tk_video_platform ivp ON ivp.id = base.video_platform_id | |
103 | + <where> | |
104 | + <if test="tenantId !=null and tenantId !=''"> | |
105 | + AND base.tenant_id = #{tenantId} | |
106 | + </if> | |
107 | + <if test="organizationIds !=null"> | |
108 | + AND base.organization_id IN | |
109 | + <foreach collection="organizationIds" item="organizationId" open="(" separator="," close=")"> | |
110 | + #{organizationId} | |
111 | + </foreach> | |
112 | + </if> | |
113 | + </where> | |
114 | + </select> | |
115 | + | |
96 | 116 | </mapper> | ... | ... |