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

@@ -76,8 +76,8 @@
delete from template_config where id = #{id}
</delete>
<select id="list" resultType="com.ycwl.basic.model.pc.template.resp.TemplateRespVO">
select t.*, s.name as scenic_name
from template t left join scenic s on s.id = t.scenic_id
select t.*
from template t
<where>
pid = 0
<if test="scenicId!=null" >
@@ -93,13 +93,13 @@
order by scenic_id, sort
</select>
<select id="getById" resultType="com.ycwl.basic.model.pc.template.resp.TemplateRespVO">
select t.*, s.name as scenic_name
from template t left join scenic s on s.id = t.scenic_id
select t.*
from template t
where t.id = #{id}
</select>
<select id="getByPid" resultType="com.ycwl.basic.model.pc.template.resp.TemplateRespVO">
select t.*, s.name as scenic_name
from template t left join scenic s on s.id = t.scenic_id
select t.*
from template t
where pid = #{id}
order by sort
</select>
@@ -113,10 +113,10 @@
order by sort
</select>
<select id="listFor" resultType="com.ycwl.basic.model.mobile.scenic.content.ContentPageVO">
select t.id templateId, t.scenic_id, s.name as scenic_name, t.`name`, pid, t.cover_url templateCoverUrl,
select t.id templateId, t.scenic_id, t.`name`, pid, t.cover_url templateCoverUrl,
0 as sourceType, sort,
t.create_time, t.price
from template t left join scenic s on s.id = t.scenic_id
from template t
where t.scenic_id = #{scenicId} and pid = 0 and t.status = 1
order by sort
</select>