feat(service): 批量获取景区和设备信息

- 在 DeviceRepository 中添加批量获取设备信息的方法
- 在 ScenicRepository 中添加批量获取景区信息的方法
- 修改 OrderServiceImpl,使用批量方法获取景区名称
- 移除多个 mapper 文件中冗余的景区信息查询
This commit is contained in:
2025-09-07 01:42:38 +08:00
parent d9a2da49bb
commit 5a89a7c60a
14 changed files with 289 additions and 60 deletions

View File

@@ -77,9 +77,8 @@
</delete>
<select id="list" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
select v.id, v.scenic_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
s.name scenicName, s.latitude, s.longitude, t.name templateName, t.price templatePrice,t.cover_url templateCoverUrl
t.name templateName, t.price templatePrice,t.cover_url templateCoverUrl
from video v
left join scenic s on s.id = v.scenic_id
left join template t on v.template_id = t.id
<where>
<if test="scenicId!= null">and v.scenic_id = #{scenicId} </if>
@@ -99,9 +98,8 @@
<select id="getById" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
select v.id, v.scenic_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
t.name templateName,t.price templatePrice, t.cover_url templateCoverUrl, t.slash_price slashPrice,
s.name scenicName, v.height, v.width, v.duration
v.height, v.width, v.duration
from video v
left join scenic s on v.scenic_id = s.id
left join template t on v.template_id = t.id
where v.id = #{id}
</select>
@@ -110,10 +108,9 @@
</select>
<select id="queryByRelation" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
select v.id, mv.scenic_id, v.template_id, mv.task_id, mv.face_id, worker_id, video_url, v.create_time, v.update_time,
s.name scenicName, t.name templateName, t.price templatePrice,t.cover_url templateCoverUrl, mv.is_buy
t.name templateName, t.price templatePrice,t.cover_url templateCoverUrl, mv.is_buy
from member_video mv
left join video v on mv.video_id = v.id
left join scenic s on s.id = v.scenic_id
left join template t on mv.template_id = t.id
<where>
<if test="scenicId!= null">and mv.scenic_id = #{scenicId} </if>