You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

54 lines
1.8 KiB

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.api.mapper.DapingMapper">
<select id="selectStationInfo" resultType="com.ruoyi.code.camera.domain.WaterPhotoInfo">
SELECT
stnm,
longitude,
latitude,
s.id,
create_time,
c.value,
c.img_name
FROM
sc_station_info s
left join sc_water_current_data c on c.stnm_id = s.id
</select>
<select id="selectWaterLevel" resultType="com.ruoyi.code.camera.domain.WaterPhotoInfo">
SELECT
s.id,
s.stnm,
s.camera_sn,
w.value
FROM
sc_station_info s
LEFT JOIN sc_water_current_data w ON w.stnm_id = s.id
</select>
<select id="selectWaterLevelTrend" resultType="com.ruoyi.code.camera.domain.WaterPhotoInfo">
SELECT
s.id,
s.stnm,
w.value,
w.tm
FROM
sc_station_info s
LEFT JOIN sc_water_data w ON w.stnm_id = s.id
WHERE
tm BETWEEN DATE_SUB( NOW(), INTERVAL 12 HOUR )
AND now()
AND RIGHT ( tm, 5 )= '00:00' and s.id=#{id}
ORDER BY
tm
</select>
<select id="selectStationInfoId" resultType="java.lang.Integer">
select id from sc_station_info
</select>
<select id="selectStationByOnlineStatus" resultType="java.util.Map">
select count(1) as value , '在线' as name from camera where status = '1';
</select>
<select id="selectStationByOfflineStatus" resultType="java.util.Map">
select count(1) as value , '不在线' as name from camera where status = '2';
</select>
</mapper>