You've already forked FrameTour-BE
feat(video): 添加通过faceId查询最新视频记录功能
- 在AppVideoController中新增getLatestByFaceId接口 - 添加VideoRespVO响应对象导入 - 实现通过faceId和可选templateId查询最新视频记录的功能 - 在VideoMapper中定义queryLatestByFaceIdAndTemplateId方法 - 在VideoRepository中实现查询逻辑 - 在VideoMapper.xml中添加对应的SQL查询语句 - 支持根据faceId和templateId条件查询最新视频记录 - 添加相应的日志记录和异常处理机制
This commit is contained in:
@@ -185,4 +185,20 @@
|
||||
from member_video
|
||||
where video_id = #{videoId} and is_buy = 1
|
||||
</select>
|
||||
|
||||
<!-- 通过faceId和templateId(可选)查询最新的视频记录 -->
|
||||
<select id="queryLatestByFaceIdAndTemplateId" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
|
||||
select v.id, v.scenic_id, v.template_id, v.task_id, v.face_id, tk.worker_id, v.video_url, v.create_time, v.update_time,
|
||||
t.name templateName, t.price templatePrice, t.cover_url templateCoverUrl,
|
||||
tk.task_params taskParams, tk.start_time, tk.end_time, v.height, v.width, v.duration
|
||||
from video v
|
||||
left join template t on v.template_id = t.id
|
||||
left join task tk on v.task_id = tk.id
|
||||
where v.face_id = #{faceId}
|
||||
<if test="templateId != null">
|
||||
and v.template_id = #{templateId}
|
||||
</if>
|
||||
order by v.create_time desc
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user