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

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>

View File

@ -117,12 +117,41 @@
left join scenic_config c on s.id = c.id
where s.id = #{id}
</select>
<select id="appList" resultType="com.ycwl.basic.model.mobile.scenic.ScenicAppVO">
select s.id, `name`, `phone`, introduction, longitude, latitude, radius, province, city, area, address
from scenic s
where
`status` = 1
<if test="name!=null and name!=''">
and locate(#{name},`name`) > 0
</if>
<if test="province!=null and province!=''">
and locate(#{province},`province`) > 0
</if>
<if test="city!=null and city!=''">
and locate(#{city},`city`) > 0
</if>
<if test="area!=null and area!=''">
and locate(#{area},`area`) > 0
</if>
<if test="startTime!=null">
and s.create_time &gt;= #{startTime}
</if>
<if test="endTime!=null">
and s.create_time &lt;= #{endTime}
</if>
</select>
<select id="getAppById" resultType="com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO">
select s.id, `name`, `phone`, introduction, longitude, latitude, radius, province, city, area, address
from scenic s
where `status` = 1 and s.id = #{id}
</select>
<resultMap id="scenicAndConfig" type="com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO">
<id property="id" column="id"/>
<result property="name" column="name"/>
<result property="account" column="account"/>
<result property="phone" column="phone"/>
<result property="account" column="account"/>
<result property="introduction" column="introduction"/>
<result property="longitude" column="longitude"/>
<result property="latitude" column="latitude"/>