查询景区信息和机位接口实现

This commit is contained in:
longbinbin
2024-12-06 10:55:49 +08:00
parent 6bfd3d2f45
commit 2b919a3c9f
14 changed files with 287 additions and 99 deletions

View File

@ -58,4 +58,18 @@
from device d
where d.scenic_id = #{scenicId}
</select>
<select id="deviceCountByScenicId" resultType="com.ycwl.basic.model.mobile.scenic.ScenicDeviceCountVO">
select ifnull(a.totalDeviceCount,0) as totalDeviceCount,ifnull(b.shotDeviceCount,0) as shotDeviceCount
from (
select count(1) totalDeviceCount,scenic_id
from device
where scenic_id = #{scenicId} and status = 1
)a
left join (
select count(1) shotDeviceCount,scenic_id
from source
where scenic_id = #{scenicId}
group by device_id
)b on a.scenic_id = b.scenic_id
</select>
</mapper>