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

@@ -14,9 +14,8 @@
WHERE scenic_id = #{scenicId} AND order_id = #{orderId}
</update>
<select id="list" resultType="com.ycwl.basic.profitsharing.dto.ProfitSharingRecordRespVO">
SELECT r.*, s.name as scenic_name
SELECT r.*
FROM profit_sharing_record r
LEFT JOIN scenic s ON s.id = r.scenic_id
<where>
<if test="withDeleted != true">
delete_time is null
@@ -65,9 +64,8 @@
GROUP BY order_id
</select>
<select id="listByOrderIds" resultType="com.ycwl.basic.profitsharing.dto.ProfitSharingRecordRespVO">
SELECT r.*, s.name as scenic_name
SELECT r.*
FROM profit_sharing_record r
LEFT JOIN scenic s ON s.id = r.scenic_id
WHERE r.order_id IN
<foreach collection="orderIds" item="orderId" open="(" close=")" separator=",">
#{orderId}