风险预警提前处置

This commit is contained in:
hayu 2024-12-16 09:43:23 +08:00
parent 18d0411e1f
commit b937ae32dd
4 changed files with 33 additions and 0 deletions

View File

@ -52,4 +52,10 @@ public interface BadWeatherMapper {
* @return
*/
int updateStatus(String id);
/**
* 获取天气预警
* @return
*/
BadWeatherEntity getBadWeatherData();
}

View File

@ -36,4 +36,10 @@ public interface BadWeatherService {
* @return
*/
int updateStatus(String id);
/**
* 数据
* @return
*/
String getBadWeatherData();
}

View File

@ -45,4 +45,14 @@ public class BadWeatherServiceImpl implements BadWeatherService {
public int updateStatus(String id) {
return mapper.updateStatus(id);
}
@Override
public String getBadWeatherData() {
BadWeatherEntity bean = mapper.getBadWeatherData();
if (bean != null){
return "今日天气:"+bean.getWeather()+",最低温度:"+bean.getMinTemperature()+"℃,最高温度:"+bean.getMaxTemperature()+"℃,预警:"+bean.getWarning();
}else {
return "";
}
}
}

View File

@ -73,4 +73,15 @@
AND date >= CURDATE()
AND date < DATE_ADD(CURDATE(), INTERVAL 7 DAY)
</select>
<select id="getBadWeatherData" resultType="com.sercurityControl.proteam.dutyTask.domain.BadWeatherEntity">
SELECT id, date, weather, min_temperature as minTemperature, max_temperature as maxTemperature, warning
FROM
t_bad_weather
WHERE
is_active=1
and `status`=1
AND DATE (date) = CURDATE()
ORDER BY update_time desc
LIMIT 1
</select>
</mapper>